//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension SWF {
    // MARK: Enums

    public enum ActivityTaskTimeoutType: String, CustomStringConvertible, Codable {
        case heartbeat = "HEARTBEAT"
        case scheduleToClose = "SCHEDULE_TO_CLOSE"
        case scheduleToStart = "SCHEDULE_TO_START"
        case startToClose = "START_TO_CLOSE"
        public var description: String { return self.rawValue }
    }

    public enum CancelTimerFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case timerIdUnknown = "TIMER_ID_UNKNOWN"
        public var description: String { return self.rawValue }
    }

    public enum CancelWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case unhandledDecision = "UNHANDLED_DECISION"
        public var description: String { return self.rawValue }
    }

    public enum ChildPolicy: String, CustomStringConvertible, Codable {
        case abandon = "ABANDON"
        case requestCancel = "REQUEST_CANCEL"
        case terminate = "TERMINATE"
        public var description: String { return self.rawValue }
    }

    public enum CloseStatus: String, CustomStringConvertible, Codable {
        case canceled = "CANCELED"
        case completed = "COMPLETED"
        case continuedAsNew = "CONTINUED_AS_NEW"
        case failed = "FAILED"
        case terminated = "TERMINATED"
        case timedOut = "TIMED_OUT"
        public var description: String { return self.rawValue }
    }

    public enum CompleteWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case unhandledDecision = "UNHANDLED_DECISION"
        public var description: String { return self.rawValue }
    }

    public enum ContinueAsNewWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case continueAsNewWorkflowExecutionRateExceeded = "CONTINUE_AS_NEW_WORKFLOW_EXECUTION_RATE_EXCEEDED"
        case defaultChildPolicyUndefined = "DEFAULT_CHILD_POLICY_UNDEFINED"
        case defaultExecutionStartToCloseTimeoutUndefined = "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED"
        case defaultTaskListUndefined = "DEFAULT_TASK_LIST_UNDEFINED"
        case defaultTaskStartToCloseTimeoutUndefined = "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED"
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case unhandledDecision = "UNHANDLED_DECISION"
        case workflowTypeDeprecated = "WORKFLOW_TYPE_DEPRECATED"
        case workflowTypeDoesNotExist = "WORKFLOW_TYPE_DOES_NOT_EXIST"
        public var description: String { return self.rawValue }
    }

    public enum DecisionTaskTimeoutType: String, CustomStringConvertible, Codable {
        case startToClose = "START_TO_CLOSE"
        public var description: String { return self.rawValue }
    }

    public enum DecisionType: String, CustomStringConvertible, Codable {
        case canceltimer = "CancelTimer"
        case cancelworkflowexecution = "CancelWorkflowExecution"
        case completeworkflowexecution = "CompleteWorkflowExecution"
        case continueasnewworkflowexecution = "ContinueAsNewWorkflowExecution"
        case failworkflowexecution = "FailWorkflowExecution"
        case recordmarker = "RecordMarker"
        case requestcancelactivitytask = "RequestCancelActivityTask"
        case requestcancelexternalworkflowexecution = "RequestCancelExternalWorkflowExecution"
        case scheduleactivitytask = "ScheduleActivityTask"
        case schedulelambdafunction = "ScheduleLambdaFunction"
        case signalexternalworkflowexecution = "SignalExternalWorkflowExecution"
        case startchildworkflowexecution = "StartChildWorkflowExecution"
        case starttimer = "StartTimer"
        public var description: String { return self.rawValue }
    }

    public enum EventType: String, CustomStringConvertible, Codable {
        case activitytaskcanceled = "ActivityTaskCanceled"
        case activitytaskcancelrequested = "ActivityTaskCancelRequested"
        case activitytaskcompleted = "ActivityTaskCompleted"
        case activitytaskfailed = "ActivityTaskFailed"
        case activitytaskscheduled = "ActivityTaskScheduled"
        case activitytaskstarted = "ActivityTaskStarted"
        case activitytasktimedout = "ActivityTaskTimedOut"
        case canceltimerfailed = "CancelTimerFailed"
        case cancelworkflowexecutionfailed = "CancelWorkflowExecutionFailed"
        case childworkflowexecutioncanceled = "ChildWorkflowExecutionCanceled"
        case childworkflowexecutioncompleted = "ChildWorkflowExecutionCompleted"
        case childworkflowexecutionfailed = "ChildWorkflowExecutionFailed"
        case childworkflowexecutionstarted = "ChildWorkflowExecutionStarted"
        case childworkflowexecutionterminated = "ChildWorkflowExecutionTerminated"
        case childworkflowexecutiontimedout = "ChildWorkflowExecutionTimedOut"
        case completeworkflowexecutionfailed = "CompleteWorkflowExecutionFailed"
        case continueasnewworkflowexecutionfailed = "ContinueAsNewWorkflowExecutionFailed"
        case decisiontaskcompleted = "DecisionTaskCompleted"
        case decisiontaskscheduled = "DecisionTaskScheduled"
        case decisiontaskstarted = "DecisionTaskStarted"
        case decisiontasktimedout = "DecisionTaskTimedOut"
        case externalworkflowexecutioncancelrequested = "ExternalWorkflowExecutionCancelRequested"
        case externalworkflowexecutionsignaled = "ExternalWorkflowExecutionSignaled"
        case failworkflowexecutionfailed = "FailWorkflowExecutionFailed"
        case lambdafunctioncompleted = "LambdaFunctionCompleted"
        case lambdafunctionfailed = "LambdaFunctionFailed"
        case lambdafunctionscheduled = "LambdaFunctionScheduled"
        case lambdafunctionstarted = "LambdaFunctionStarted"
        case lambdafunctiontimedout = "LambdaFunctionTimedOut"
        case markerrecorded = "MarkerRecorded"
        case recordmarkerfailed = "RecordMarkerFailed"
        case requestcancelactivitytaskfailed = "RequestCancelActivityTaskFailed"
        case requestcancelexternalworkflowexecutionfailed = "RequestCancelExternalWorkflowExecutionFailed"
        case requestcancelexternalworkflowexecutioninitiated = "RequestCancelExternalWorkflowExecutionInitiated"
        case scheduleactivitytaskfailed = "ScheduleActivityTaskFailed"
        case schedulelambdafunctionfailed = "ScheduleLambdaFunctionFailed"
        case signalexternalworkflowexecutionfailed = "SignalExternalWorkflowExecutionFailed"
        case signalexternalworkflowexecutioninitiated = "SignalExternalWorkflowExecutionInitiated"
        case startchildworkflowexecutionfailed = "StartChildWorkflowExecutionFailed"
        case startchildworkflowexecutioninitiated = "StartChildWorkflowExecutionInitiated"
        case startlambdafunctionfailed = "StartLambdaFunctionFailed"
        case starttimerfailed = "StartTimerFailed"
        case timercanceled = "TimerCanceled"
        case timerfired = "TimerFired"
        case timerstarted = "TimerStarted"
        case workflowexecutioncanceled = "WorkflowExecutionCanceled"
        case workflowexecutioncancelrequested = "WorkflowExecutionCancelRequested"
        case workflowexecutioncompleted = "WorkflowExecutionCompleted"
        case workflowexecutioncontinuedasnew = "WorkflowExecutionContinuedAsNew"
        case workflowexecutionfailed = "WorkflowExecutionFailed"
        case workflowexecutionsignaled = "WorkflowExecutionSignaled"
        case workflowexecutionstarted = "WorkflowExecutionStarted"
        case workflowexecutionterminated = "WorkflowExecutionTerminated"
        case workflowexecutiontimedout = "WorkflowExecutionTimedOut"
        public var description: String { return self.rawValue }
    }

    public enum ExecutionStatus: String, CustomStringConvertible, Codable {
        case closed = "CLOSED"
        case open = "OPEN"
        public var description: String { return self.rawValue }
    }

    public enum FailWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case unhandledDecision = "UNHANDLED_DECISION"
        public var description: String { return self.rawValue }
    }

    public enum LambdaFunctionTimeoutType: String, CustomStringConvertible, Codable {
        case startToClose = "START_TO_CLOSE"
        public var description: String { return self.rawValue }
    }

    public enum RecordMarkerFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        public var description: String { return self.rawValue }
    }

    public enum RegistrationStatus: String, CustomStringConvertible, Codable {
        case deprecated = "DEPRECATED"
        case registered = "REGISTERED"
        public var description: String { return self.rawValue }
    }

    public enum RequestCancelActivityTaskFailedCause: String, CustomStringConvertible, Codable {
        case activityIdUnknown = "ACTIVITY_ID_UNKNOWN"
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        public var description: String { return self.rawValue }
    }

    public enum RequestCancelExternalWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case requestCancelExternalWorkflowExecutionRateExceeded = "REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED"
        case unknownExternalWorkflowExecution = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"
        public var description: String { return self.rawValue }
    }

    public enum ScheduleActivityTaskFailedCause: String, CustomStringConvertible, Codable {
        case activityCreationRateExceeded = "ACTIVITY_CREATION_RATE_EXCEEDED"
        case activityIdAlreadyInUse = "ACTIVITY_ID_ALREADY_IN_USE"
        case activityTypeDeprecated = "ACTIVITY_TYPE_DEPRECATED"
        case activityTypeDoesNotExist = "ACTIVITY_TYPE_DOES_NOT_EXIST"
        case defaultHeartbeatTimeoutUndefined = "DEFAULT_HEARTBEAT_TIMEOUT_UNDEFINED"
        case defaultScheduleToCloseTimeoutUndefined = "DEFAULT_SCHEDULE_TO_CLOSE_TIMEOUT_UNDEFINED"
        case defaultScheduleToStartTimeoutUndefined = "DEFAULT_SCHEDULE_TO_START_TIMEOUT_UNDEFINED"
        case defaultStartToCloseTimeoutUndefined = "DEFAULT_START_TO_CLOSE_TIMEOUT_UNDEFINED"
        case defaultTaskListUndefined = "DEFAULT_TASK_LIST_UNDEFINED"
        case openActivitiesLimitExceeded = "OPEN_ACTIVITIES_LIMIT_EXCEEDED"
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        public var description: String { return self.rawValue }
    }

    public enum ScheduleLambdaFunctionFailedCause: String, CustomStringConvertible, Codable {
        case idAlreadyInUse = "ID_ALREADY_IN_USE"
        case lambdaFunctionCreationRateExceeded = "LAMBDA_FUNCTION_CREATION_RATE_EXCEEDED"
        case lambdaServiceNotAvailableInRegion = "LAMBDA_SERVICE_NOT_AVAILABLE_IN_REGION"
        case openLambdaFunctionsLimitExceeded = "OPEN_LAMBDA_FUNCTIONS_LIMIT_EXCEEDED"
        public var description: String { return self.rawValue }
    }

    public enum SignalExternalWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case signalExternalWorkflowExecutionRateExceeded = "SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED"
        case unknownExternalWorkflowExecution = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"
        public var description: String { return self.rawValue }
    }

    public enum StartChildWorkflowExecutionFailedCause: String, CustomStringConvertible, Codable {
        case childCreationRateExceeded = "CHILD_CREATION_RATE_EXCEEDED"
        case defaultChildPolicyUndefined = "DEFAULT_CHILD_POLICY_UNDEFINED"
        case defaultExecutionStartToCloseTimeoutUndefined = "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED"
        case defaultTaskListUndefined = "DEFAULT_TASK_LIST_UNDEFINED"
        case defaultTaskStartToCloseTimeoutUndefined = "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED"
        case openChildrenLimitExceeded = "OPEN_CHILDREN_LIMIT_EXCEEDED"
        case openWorkflowsLimitExceeded = "OPEN_WORKFLOWS_LIMIT_EXCEEDED"
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case workflowAlreadyRunning = "WORKFLOW_ALREADY_RUNNING"
        case workflowTypeDeprecated = "WORKFLOW_TYPE_DEPRECATED"
        case workflowTypeDoesNotExist = "WORKFLOW_TYPE_DOES_NOT_EXIST"
        public var description: String { return self.rawValue }
    }

    public enum StartLambdaFunctionFailedCause: String, CustomStringConvertible, Codable {
        case assumeRoleFailed = "ASSUME_ROLE_FAILED"
        public var description: String { return self.rawValue }
    }

    public enum StartTimerFailedCause: String, CustomStringConvertible, Codable {
        case openTimersLimitExceeded = "OPEN_TIMERS_LIMIT_EXCEEDED"
        case operationNotPermitted = "OPERATION_NOT_PERMITTED"
        case timerCreationRateExceeded = "TIMER_CREATION_RATE_EXCEEDED"
        case timerIdAlreadyInUse = "TIMER_ID_ALREADY_IN_USE"
        public var description: String { return self.rawValue }
    }

    public enum WorkflowExecutionCancelRequestedCause: String, CustomStringConvertible, Codable {
        case childPolicyApplied = "CHILD_POLICY_APPLIED"
        public var description: String { return self.rawValue }
    }

    public enum WorkflowExecutionTerminatedCause: String, CustomStringConvertible, Codable {
        case childPolicyApplied = "CHILD_POLICY_APPLIED"
        case eventLimitExceeded = "EVENT_LIMIT_EXCEEDED"
        case operatorInitiated = "OPERATOR_INITIATED"
        public var description: String { return self.rawValue }
    }

    public enum WorkflowExecutionTimeoutType: String, CustomStringConvertible, Codable {
        case startToClose = "START_TO_CLOSE"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct ActivityTask: AWSDecodableShape {
        /// The unique ID of the task.
        public let activityId: String
        /// The type of this activity task.
        public let activityType: ActivityType
        /// The inputs provided when the activity task was scheduled. The form of the input is user defined and should be meaningful to the activity implementation.
        public let input: String?
        /// The ID of the ActivityTaskStarted event recorded in the history.
        public let startedEventId: Int64
        /// The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.
        public let taskToken: String
        /// The workflow execution that started this activity task.
        public let workflowExecution: WorkflowExecution

        public init(activityId: String, activityType: ActivityType, input: String? = nil, startedEventId: Int64, taskToken: String, workflowExecution: WorkflowExecution) {
            self.activityId = activityId
            self.activityType = activityType
            self.input = input
            self.startedEventId = startedEventId
            self.taskToken = taskToken
            self.workflowExecution = workflowExecution
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
            case activityType
            case input
            case startedEventId
            case taskToken
            case workflowExecution
        }
    }

    public struct ActivityTaskCancelRequestedEventAttributes: AWSDecodableShape {
        /// The unique ID of the task.
        public let activityId: String
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the RequestCancelActivityTask decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(activityId: String, decisionTaskCompletedEventId: Int64) {
            self.activityId = activityId
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
            case decisionTaskCompletedEventId
        }
    }

    public struct ActivityTaskCanceledEventAttributes: AWSDecodableShape {
        /// Details of the cancellation.
        public let details: String?
        /// If set, contains the ID of the last ActivityTaskCancelRequested event recorded for this activity task. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let latestCancelRequestedEventId: Int64?
        /// The ID of the ActivityTaskScheduled event that was recorded when this activity task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the ActivityTaskStarted event recorded when this activity task was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64

        public init(details: String? = nil, latestCancelRequestedEventId: Int64? = nil, scheduledEventId: Int64, startedEventId: Int64) {
            self.details = details
            self.latestCancelRequestedEventId = latestCancelRequestedEventId
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case latestCancelRequestedEventId
            case scheduledEventId
            case startedEventId
        }
    }

    public struct ActivityTaskCompletedEventAttributes: AWSDecodableShape {
        /// The results of the activity task.
        public let result: String?
        /// The ID of the ActivityTaskScheduled event that was recorded when this activity task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the ActivityTaskStarted event recorded when this activity task was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64

        public init(result: String? = nil, scheduledEventId: Int64, startedEventId: Int64) {
            self.result = result
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case result
            case scheduledEventId
            case startedEventId
        }
    }

    public struct ActivityTaskFailedEventAttributes: AWSDecodableShape {
        /// The details of the failure.
        public let details: String?
        /// The reason provided for the failure.
        public let reason: String?
        /// The ID of the ActivityTaskScheduled event that was recorded when this activity task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the ActivityTaskStarted event recorded when this activity task was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64

        public init(details: String? = nil, reason: String? = nil, scheduledEventId: Int64, startedEventId: Int64) {
            self.details = details
            self.reason = reason
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case reason
            case scheduledEventId
            case startedEventId
        }
    }

    public struct ActivityTaskScheduledEventAttributes: AWSDecodableShape {
        /// The unique ID of the activity task.
        public let activityId: String
        /// The type of the activity task.
        public let activityType: ActivityType
        /// Data attached to the event that can be used by the decider in subsequent workflow tasks. This data isn't sent to the activity.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision that resulted in the scheduling of this activity task. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The maximum time before which the worker processing this task must report progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically timed out. If the worker subsequently attempts to record a heartbeat or return a result, it is ignored.
        public let heartbeatTimeout: String?
        /// The input provided to the activity task.
        public let input: String?
        /// The maximum amount of time for this activity task.
        public let scheduleToCloseTimeout: String?
        /// The maximum amount of time the activity task can wait to be assigned to a worker.
        public let scheduleToStartTimeout: String?
        /// The maximum amount of time a worker may take to process the activity task.
        public let startToCloseTimeout: String?
        /// The task list in which the activity task has been scheduled.
        public let taskList: TaskList
        ///  The priority to assign to the scheduled activity task. If set, this overrides any default priority value that was assigned when the activity type was registered. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?

        public init(activityId: String, activityType: ActivityType, control: String? = nil, decisionTaskCompletedEventId: Int64, heartbeatTimeout: String? = nil, input: String? = nil, scheduleToCloseTimeout: String? = nil, scheduleToStartTimeout: String? = nil, startToCloseTimeout: String? = nil, taskList: TaskList, taskPriority: String? = nil) {
            self.activityId = activityId
            self.activityType = activityType
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.heartbeatTimeout = heartbeatTimeout
            self.input = input
            self.scheduleToCloseTimeout = scheduleToCloseTimeout
            self.scheduleToStartTimeout = scheduleToStartTimeout
            self.startToCloseTimeout = startToCloseTimeout
            self.taskList = taskList
            self.taskPriority = taskPriority
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
            case activityType
            case control
            case decisionTaskCompletedEventId
            case heartbeatTimeout
            case input
            case scheduleToCloseTimeout
            case scheduleToStartTimeout
            case startToCloseTimeout
            case taskList
            case taskPriority
        }
    }

    public struct ActivityTaskStartedEventAttributes: AWSDecodableShape {
        /// Identity of the worker that was assigned this task. This aids diagnostics when problems arise. The form of this identity is user defined.
        public let identity: String?
        /// The ID of the ActivityTaskScheduled event that was recorded when this activity task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64

        public init(identity: String? = nil, scheduledEventId: Int64) {
            self.identity = identity
            self.scheduledEventId = scheduledEventId
        }

        private enum CodingKeys: String, CodingKey {
            case identity
            case scheduledEventId
        }
    }

    public struct ActivityTaskStatus: AWSDecodableShape {
        /// Set to true if cancellation of the task is requested.
        public let cancelRequested: Bool

        public init(cancelRequested: Bool) {
            self.cancelRequested = cancelRequested
        }

        private enum CodingKeys: String, CodingKey {
            case cancelRequested
        }
    }

    public struct ActivityTaskTimedOutEventAttributes: AWSDecodableShape {
        /// Contains the content of the details parameter for the last call made by the activity to RecordActivityTaskHeartbeat.
        public let details: String?
        /// The ID of the ActivityTaskScheduled event that was recorded when this activity task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the ActivityTaskStarted event recorded when this activity task was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The type of the timeout that caused this event.
        public let timeoutType: ActivityTaskTimeoutType

        public init(details: String? = nil, scheduledEventId: Int64, startedEventId: Int64, timeoutType: ActivityTaskTimeoutType) {
            self.details = details
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
            self.timeoutType = timeoutType
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case scheduledEventId
            case startedEventId
            case timeoutType
        }
    }

    public struct ActivityType: AWSEncodableShape & AWSDecodableShape {
        /// The name of this activity.  The combination of activity type name and version must be unique within a domain.
        public let name: String
        /// The version of this activity.  The combination of activity type name and version must be unique with in a domain.
        public let version: String

        public init(name: String, version: String) {
            self.name = name
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, max: 64)
            try self.validate(self.version, name: "version", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case version
        }
    }

    public struct ActivityTypeConfiguration: AWSDecodableShape {
        ///  The default maximum time, in seconds, before which a worker processing a task must report progress by calling RecordActivityTaskHeartbeat. You can specify this value only when registering an activity type. The registered default value can be overridden when you schedule a task through the ScheduleActivityTask Decision. If the activity worker subsequently attempts to record a heartbeat or returns a result, the activity worker receives an UnknownResource fault. In this case, Amazon SWF no longer considers the activity task to be valid; the activity worker should clean up the activity task. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskHeartbeatTimeout: String?
        ///  The default task list specified for this activity type at registration. This default is used if a task list isn't provided when a task is scheduled through the ScheduleActivityTask Decision. You can override the default registered task list when scheduling a task through the ScheduleActivityTask Decision.
        public let defaultTaskList: TaskList?
        ///  The default task priority for tasks of this activity type, specified at registration. If not set, then 0 is used as the default priority. This default can be overridden when scheduling an activity task. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let defaultTaskPriority: String?
        ///  The default maximum duration, specified when registering the activity type, for tasks of this activity type. You can override this default when scheduling a task through the ScheduleActivityTask Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskScheduleToCloseTimeout: String?
        ///  The default maximum duration, specified when registering the activity type, that a task of an activity type can wait before being assigned to a worker. You can override this default when scheduling a task through the ScheduleActivityTask Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskScheduleToStartTimeout: String?
        ///  The default maximum duration for tasks of an activity type specified when registering the activity type. You can override this default when scheduling a task through the ScheduleActivityTask Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskStartToCloseTimeout: String?

        public init(defaultTaskHeartbeatTimeout: String? = nil, defaultTaskList: TaskList? = nil, defaultTaskPriority: String? = nil, defaultTaskScheduleToCloseTimeout: String? = nil, defaultTaskScheduleToStartTimeout: String? = nil, defaultTaskStartToCloseTimeout: String? = nil) {
            self.defaultTaskHeartbeatTimeout = defaultTaskHeartbeatTimeout
            self.defaultTaskList = defaultTaskList
            self.defaultTaskPriority = defaultTaskPriority
            self.defaultTaskScheduleToCloseTimeout = defaultTaskScheduleToCloseTimeout
            self.defaultTaskScheduleToStartTimeout = defaultTaskScheduleToStartTimeout
            self.defaultTaskStartToCloseTimeout = defaultTaskStartToCloseTimeout
        }

        private enum CodingKeys: String, CodingKey {
            case defaultTaskHeartbeatTimeout
            case defaultTaskList
            case defaultTaskPriority
            case defaultTaskScheduleToCloseTimeout
            case defaultTaskScheduleToStartTimeout
            case defaultTaskStartToCloseTimeout
        }
    }

    public struct ActivityTypeDetail: AWSDecodableShape {
        /// The configuration settings registered with the activity type.
        public let configuration: ActivityTypeConfiguration
        /// General information about the activity type. The status of activity type (returned in the ActivityTypeInfo structure) can be one of the following.    REGISTERED – The type is registered and available. Workers supporting this type should be running.     DEPRECATED – The type was deprecated using DeprecateActivityType, but is still in use. You should keep workers supporting this type running. You cannot create new tasks of this type.
        public let typeInfo: ActivityTypeInfo

        public init(configuration: ActivityTypeConfiguration, typeInfo: ActivityTypeInfo) {
            self.configuration = configuration
            self.typeInfo = typeInfo
        }

        private enum CodingKeys: String, CodingKey {
            case configuration
            case typeInfo
        }
    }

    public struct ActivityTypeInfo: AWSDecodableShape {
        /// The ActivityType type structure representing the activity type.
        public let activityType: ActivityType
        /// The date and time this activity type was created through RegisterActivityType.
        public let creationDate: Date
        /// If DEPRECATED, the date and time DeprecateActivityType was called.
        public let deprecationDate: Date?
        /// The description of the activity type provided in RegisterActivityType.
        public let description: String?
        /// The current status of the activity type.
        public let status: RegistrationStatus

        public init(activityType: ActivityType, creationDate: Date, deprecationDate: Date? = nil, description: String? = nil, status: RegistrationStatus) {
            self.activityType = activityType
            self.creationDate = creationDate
            self.deprecationDate = deprecationDate
            self.description = description
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case activityType
            case creationDate
            case deprecationDate
            case description
            case status
        }
    }

    public struct ActivityTypeInfos: AWSDecodableShape {
        /// If a NextPageToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextPageToken. Keep all other arguments unchanged. The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// List of activity type information.
        public let typeInfos: [ActivityTypeInfo]

        public init(nextPageToken: String? = nil, typeInfos: [ActivityTypeInfo]) {
            self.nextPageToken = nextPageToken
            self.typeInfos = typeInfos
        }

        private enum CodingKeys: String, CodingKey {
            case nextPageToken
            case typeInfos
        }
    }

    public struct CancelTimerDecisionAttributes: AWSEncodableShape {
        ///  The unique ID of the timer to cancel.
        public let timerId: String

        public init(timerId: String) {
            self.timerId = timerId
        }

        public func validate(name: String) throws {
            try self.validate(self.timerId, name: "timerId", parent: name, max: 256)
            try self.validate(self.timerId, name: "timerId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case timerId
        }
    }

    public struct CancelTimerFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: CancelTimerFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the CancelTimer decision to cancel this timer. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The timerId provided in the CancelTimer decision that failed.
        public let timerId: String

        public init(cause: CancelTimerFailedCause, decisionTaskCompletedEventId: Int64, timerId: String) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.timerId = timerId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
            case timerId
        }
    }

    public struct CancelWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        ///  Details of the cancellation.
        public let details: String?

        public init(details: String? = nil) {
            self.details = details
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 32768)
        }

        private enum CodingKeys: String, CodingKey {
            case details
        }
    }

    public struct CancelWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: CancelWorkflowExecutionFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the CancelWorkflowExecution decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(cause: CancelWorkflowExecutionFailedCause, decisionTaskCompletedEventId: Int64) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
        }
    }

    public struct ChildWorkflowExecutionCanceledEventAttributes: AWSDecodableShape {
        /// Details of the cancellation (if provided).
        public let details: String?
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The ID of the ChildWorkflowExecutionStarted event recorded when this child workflow execution was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The child workflow execution that was canceled.
        public let workflowExecution: WorkflowExecution
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(details: String? = nil, initiatedEventId: Int64, startedEventId: Int64, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.details = details
            self.initiatedEventId = initiatedEventId
            self.startedEventId = startedEventId
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case initiatedEventId
            case startedEventId
            case workflowExecution
            case workflowType
        }
    }

    public struct ChildWorkflowExecutionCompletedEventAttributes: AWSDecodableShape {
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The result of the child workflow execution.
        public let result: String?
        /// The ID of the ChildWorkflowExecutionStarted event recorded when this child workflow execution was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The child workflow execution that was completed.
        public let workflowExecution: WorkflowExecution
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(initiatedEventId: Int64, result: String? = nil, startedEventId: Int64, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.initiatedEventId = initiatedEventId
            self.result = result
            self.startedEventId = startedEventId
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedEventId
            case result
            case startedEventId
            case workflowExecution
            case workflowType
        }
    }

    public struct ChildWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The details of the failure (if provided).
        public let details: String?
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The reason for the failure (if provided).
        public let reason: String?
        /// The ID of the ChildWorkflowExecutionStarted event recorded when this child workflow execution was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The child workflow execution that failed.
        public let workflowExecution: WorkflowExecution
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(details: String? = nil, initiatedEventId: Int64, reason: String? = nil, startedEventId: Int64, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.details = details
            self.initiatedEventId = initiatedEventId
            self.reason = reason
            self.startedEventId = startedEventId
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case initiatedEventId
            case reason
            case startedEventId
            case workflowExecution
            case workflowType
        }
    }

    public struct ChildWorkflowExecutionStartedEventAttributes: AWSDecodableShape {
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The child workflow execution that was started.
        public let workflowExecution: WorkflowExecution
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(initiatedEventId: Int64, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.initiatedEventId = initiatedEventId
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedEventId
            case workflowExecution
            case workflowType
        }
    }

    public struct ChildWorkflowExecutionTerminatedEventAttributes: AWSDecodableShape {
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The ID of the ChildWorkflowExecutionStarted event recorded when this child workflow execution was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The child workflow execution that was terminated.
        public let workflowExecution: WorkflowExecution
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(initiatedEventId: Int64, startedEventId: Int64, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.initiatedEventId = initiatedEventId
            self.startedEventId = startedEventId
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedEventId
            case startedEventId
            case workflowExecution
            case workflowType
        }
    }

    public struct ChildWorkflowExecutionTimedOutEventAttributes: AWSDecodableShape {
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The ID of the ChildWorkflowExecutionStarted event recorded when this child workflow execution was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The type of the timeout that caused the child workflow execution to time out.
        public let timeoutType: WorkflowExecutionTimeoutType
        /// The child workflow execution that timed out.
        public let workflowExecution: WorkflowExecution
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(initiatedEventId: Int64, startedEventId: Int64, timeoutType: WorkflowExecutionTimeoutType, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.initiatedEventId = initiatedEventId
            self.startedEventId = startedEventId
            self.timeoutType = timeoutType
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedEventId
            case startedEventId
            case timeoutType
            case workflowExecution
            case workflowType
        }
    }

    public struct CloseStatusFilter: AWSEncodableShape {
        ///  The close status that must match the close status of an execution for it to meet the criteria of this filter.
        public let status: CloseStatus

        public init(status: CloseStatus) {
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case status
        }
    }

    public struct CompleteWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        /// The result of the workflow execution. The form of the result is implementation defined.
        public let result: String?

        public init(result: String? = nil) {
            self.result = result
        }

        public func validate(name: String) throws {
            try self.validate(self.result, name: "result", parent: name, max: 32768)
        }

        private enum CodingKeys: String, CodingKey {
            case result
        }
    }

    public struct CompleteWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: CompleteWorkflowExecutionFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the CompleteWorkflowExecution decision to complete this execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(cause: CompleteWorkflowExecutionFailedCause, decisionTaskCompletedEventId: Int64) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
        }
    }

    public struct ContinueAsNewWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        /// If set, specifies the policy to use for the child workflow executions of the new execution if it is terminated by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using RegisterWorkflowType. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.    A child policy for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default child policy was specified at registration time then a fault is returned.
        public let childPolicy: ChildPolicy?
        /// If set, specifies the total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  An execution start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this field. If neither this field is set nor a default execution start-to-close timeout was specified at registration time then a fault is returned.
        public let executionStartToCloseTimeout: String?
        /// The input provided to the new workflow execution.
        public let input: String?
        /// The IAM role to attach to the new (continued) execution.
        public let lambdaRole: String?
        /// The list of tags to associate with the new workflow execution. A maximum of 5 tags can be specified. You can list workflow executions with a specific tag by calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and specifying a TagFilter.
        public let tagList: [String]?
        /// The task list to use for the decisions of the new (continued) workflow execution.
        public let taskList: TaskList?
        ///  The task priority that, if set, specifies the priority for the decision tasks for this workflow execution. This overrides the defaultTaskPriority specified when registering the workflow type. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?
        /// Specifies the maximum duration of decision tasks for the new workflow execution. This parameter overrides the defaultTaskStartToCloseTimout specified when registering the workflow type using RegisterWorkflowType. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  A task start-to-close timeout for the new workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault is returned.
        public let taskStartToCloseTimeout: String?
        /// The version of the workflow to start.
        public let workflowTypeVersion: String?

        public init(childPolicy: ChildPolicy? = nil, executionStartToCloseTimeout: String? = nil, input: String? = nil, lambdaRole: String? = nil, tagList: [String]? = nil, taskList: TaskList? = nil, taskPriority: String? = nil, taskStartToCloseTimeout: String? = nil, workflowTypeVersion: String? = nil) {
            self.childPolicy = childPolicy
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.input = input
            self.lambdaRole = lambdaRole
            self.tagList = tagList
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
            self.workflowTypeVersion = workflowTypeVersion
        }

        public func validate(name: String) throws {
            try self.validate(self.executionStartToCloseTimeout, name: "executionStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.lambdaRole, name: "lambdaRole", parent: name, max: 1600)
            try self.validate(self.lambdaRole, name: "lambdaRole", parent: name, min: 1)
            try self.tagList?.forEach {
                try validate($0, name: "tagList[]", parent: name, max: 256)
                try validate($0, name: "tagList[]", parent: name, min: 0)
            }
            try self.validate(self.tagList, name: "tagList", parent: name, max: 5)
            try self.taskList?.validate(name: "\(name).taskList")
            try self.validate(self.taskStartToCloseTimeout, name: "taskStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.workflowTypeVersion, name: "workflowTypeVersion", parent: name, max: 64)
            try self.validate(self.workflowTypeVersion, name: "workflowTypeVersion", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case executionStartToCloseTimeout
            case input
            case lambdaRole
            case tagList
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
            case workflowTypeVersion
        }
    }

    public struct ContinueAsNewWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: ContinueAsNewWorkflowExecutionFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the ContinueAsNewWorkflowExecution decision that started this execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(cause: ContinueAsNewWorkflowExecutionFailedCause, decisionTaskCompletedEventId: Int64) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
        }
    }

    public struct CountClosedWorkflowExecutionsInput: AWSEncodableShape {
        /// If specified, only workflow executions that match this close status are counted. This filter has an affect only if executionStatus is specified as CLOSED.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let closeStatusFilter: CloseStatusFilter?
        /// If specified, only workflow executions that meet the close time criteria of the filter are counted.   startTimeFilter and closeTimeFilter are mutually exclusive. You must specify one of these in a request but not both.
        public let closeTimeFilter: ExecutionTimeFilter?
        /// The name of the domain containing the workflow executions to count.
        public let domain: String
        /// If specified, only workflow executions matching the WorkflowId in the filter are counted.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let executionFilter: WorkflowExecutionFilter?
        /// If specified, only workflow executions that meet the start time criteria of the filter are counted.   startTimeFilter and closeTimeFilter are mutually exclusive. You must specify one of these in a request but not both.
        public let startTimeFilter: ExecutionTimeFilter?
        /// If specified, only executions that have a tag that matches the filter are counted.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let tagFilter: TagFilter?
        /// If specified, indicates the type of the workflow executions to be counted.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let typeFilter: WorkflowTypeFilter?

        public init(closeStatusFilter: CloseStatusFilter? = nil, closeTimeFilter: ExecutionTimeFilter? = nil, domain: String, executionFilter: WorkflowExecutionFilter? = nil, startTimeFilter: ExecutionTimeFilter? = nil, tagFilter: TagFilter? = nil, typeFilter: WorkflowTypeFilter? = nil) {
            self.closeStatusFilter = closeStatusFilter
            self.closeTimeFilter = closeTimeFilter
            self.domain = domain
            self.executionFilter = executionFilter
            self.startTimeFilter = startTimeFilter
            self.tagFilter = tagFilter
            self.typeFilter = typeFilter
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.executionFilter?.validate(name: "\(name).executionFilter")
            try self.tagFilter?.validate(name: "\(name).tagFilter")
            try self.typeFilter?.validate(name: "\(name).typeFilter")
        }

        private enum CodingKeys: String, CodingKey {
            case closeStatusFilter
            case closeTimeFilter
            case domain
            case executionFilter
            case startTimeFilter
            case tagFilter
            case typeFilter
        }
    }

    public struct CountOpenWorkflowExecutionsInput: AWSEncodableShape {
        /// The name of the domain containing the workflow executions to count.
        public let domain: String
        /// If specified, only workflow executions matching the WorkflowId in the filter are counted.   executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let executionFilter: WorkflowExecutionFilter?
        /// Specifies the start time criteria that workflow executions must meet in order to be counted.
        public let startTimeFilter: ExecutionTimeFilter
        /// If specified, only executions that have a tag that matches the filter are counted.   executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let tagFilter: TagFilter?
        /// Specifies the type of the workflow executions to be counted.   executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let typeFilter: WorkflowTypeFilter?

        public init(domain: String, executionFilter: WorkflowExecutionFilter? = nil, startTimeFilter: ExecutionTimeFilter, tagFilter: TagFilter? = nil, typeFilter: WorkflowTypeFilter? = nil) {
            self.domain = domain
            self.executionFilter = executionFilter
            self.startTimeFilter = startTimeFilter
            self.tagFilter = tagFilter
            self.typeFilter = typeFilter
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.executionFilter?.validate(name: "\(name).executionFilter")
            try self.tagFilter?.validate(name: "\(name).tagFilter")
            try self.typeFilter?.validate(name: "\(name).typeFilter")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case executionFilter
            case startTimeFilter
            case tagFilter
            case typeFilter
        }
    }

    public struct CountPendingActivityTasksInput: AWSEncodableShape {
        /// The name of the domain that contains the task list.
        public let domain: String
        /// The name of the task list.
        public let taskList: TaskList

        public init(domain: String, taskList: TaskList) {
            self.domain = domain
            self.taskList = taskList
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.taskList.validate(name: "\(name).taskList")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case taskList
        }
    }

    public struct CountPendingDecisionTasksInput: AWSEncodableShape {
        /// The name of the domain that contains the task list.
        public let domain: String
        /// The name of the task list.
        public let taskList: TaskList

        public init(domain: String, taskList: TaskList) {
            self.domain = domain
            self.taskList = taskList
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.taskList.validate(name: "\(name).taskList")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case taskList
        }
    }

    public struct Decision: AWSEncodableShape {
        /// Provides the details of the CancelTimer decision. It isn't set for other decision types.
        public let cancelTimerDecisionAttributes: CancelTimerDecisionAttributes?
        /// Provides the details of the CancelWorkflowExecution decision. It isn't set for other decision types.
        public let cancelWorkflowExecutionDecisionAttributes: CancelWorkflowExecutionDecisionAttributes?
        /// Provides the details of the CompleteWorkflowExecution decision. It isn't set for other decision types.
        public let completeWorkflowExecutionDecisionAttributes: CompleteWorkflowExecutionDecisionAttributes?
        /// Provides the details of the ContinueAsNewWorkflowExecution decision. It isn't set for other decision types.
        public let continueAsNewWorkflowExecutionDecisionAttributes: ContinueAsNewWorkflowExecutionDecisionAttributes?
        /// Specifies the type of the decision.
        public let decisionType: DecisionType
        /// Provides the details of the FailWorkflowExecution decision. It isn't set for other decision types.
        public let failWorkflowExecutionDecisionAttributes: FailWorkflowExecutionDecisionAttributes?
        /// Provides the details of the RecordMarker decision. It isn't set for other decision types.
        public let recordMarkerDecisionAttributes: RecordMarkerDecisionAttributes?
        /// Provides the details of the RequestCancelActivityTask decision. It isn't set for other decision types.
        public let requestCancelActivityTaskDecisionAttributes: RequestCancelActivityTaskDecisionAttributes?
        /// Provides the details of the RequestCancelExternalWorkflowExecution decision. It isn't set for other decision types.
        public let requestCancelExternalWorkflowExecutionDecisionAttributes: RequestCancelExternalWorkflowExecutionDecisionAttributes?
        /// Provides the details of the ScheduleActivityTask decision. It isn't set for other decision types.
        public let scheduleActivityTaskDecisionAttributes: ScheduleActivityTaskDecisionAttributes?
        /// Provides the details of the ScheduleLambdaFunction decision. It isn't set for other decision types.
        public let scheduleLambdaFunctionDecisionAttributes: ScheduleLambdaFunctionDecisionAttributes?
        /// Provides the details of the SignalExternalWorkflowExecution decision. It isn't set for other decision types.
        public let signalExternalWorkflowExecutionDecisionAttributes: SignalExternalWorkflowExecutionDecisionAttributes?
        /// Provides the details of the StartChildWorkflowExecution decision. It isn't set for other decision types.
        public let startChildWorkflowExecutionDecisionAttributes: StartChildWorkflowExecutionDecisionAttributes?
        /// Provides the details of the StartTimer decision. It isn't set for other decision types.
        public let startTimerDecisionAttributes: StartTimerDecisionAttributes?

        public init(cancelTimerDecisionAttributes: CancelTimerDecisionAttributes? = nil, cancelWorkflowExecutionDecisionAttributes: CancelWorkflowExecutionDecisionAttributes? = nil, completeWorkflowExecutionDecisionAttributes: CompleteWorkflowExecutionDecisionAttributes? = nil, continueAsNewWorkflowExecutionDecisionAttributes: ContinueAsNewWorkflowExecutionDecisionAttributes? = nil, decisionType: DecisionType, failWorkflowExecutionDecisionAttributes: FailWorkflowExecutionDecisionAttributes? = nil, recordMarkerDecisionAttributes: RecordMarkerDecisionAttributes? = nil, requestCancelActivityTaskDecisionAttributes: RequestCancelActivityTaskDecisionAttributes? = nil, requestCancelExternalWorkflowExecutionDecisionAttributes: RequestCancelExternalWorkflowExecutionDecisionAttributes? = nil, scheduleActivityTaskDecisionAttributes: ScheduleActivityTaskDecisionAttributes? = nil, scheduleLambdaFunctionDecisionAttributes: ScheduleLambdaFunctionDecisionAttributes? = nil, signalExternalWorkflowExecutionDecisionAttributes: SignalExternalWorkflowExecutionDecisionAttributes? = nil, startChildWorkflowExecutionDecisionAttributes: StartChildWorkflowExecutionDecisionAttributes? = nil, startTimerDecisionAttributes: StartTimerDecisionAttributes? = nil) {
            self.cancelTimerDecisionAttributes = cancelTimerDecisionAttributes
            self.cancelWorkflowExecutionDecisionAttributes = cancelWorkflowExecutionDecisionAttributes
            self.completeWorkflowExecutionDecisionAttributes = completeWorkflowExecutionDecisionAttributes
            self.continueAsNewWorkflowExecutionDecisionAttributes = continueAsNewWorkflowExecutionDecisionAttributes
            self.decisionType = decisionType
            self.failWorkflowExecutionDecisionAttributes = failWorkflowExecutionDecisionAttributes
            self.recordMarkerDecisionAttributes = recordMarkerDecisionAttributes
            self.requestCancelActivityTaskDecisionAttributes = requestCancelActivityTaskDecisionAttributes
            self.requestCancelExternalWorkflowExecutionDecisionAttributes = requestCancelExternalWorkflowExecutionDecisionAttributes
            self.scheduleActivityTaskDecisionAttributes = scheduleActivityTaskDecisionAttributes
            self.scheduleLambdaFunctionDecisionAttributes = scheduleLambdaFunctionDecisionAttributes
            self.signalExternalWorkflowExecutionDecisionAttributes = signalExternalWorkflowExecutionDecisionAttributes
            self.startChildWorkflowExecutionDecisionAttributes = startChildWorkflowExecutionDecisionAttributes
            self.startTimerDecisionAttributes = startTimerDecisionAttributes
        }

        public func validate(name: String) throws {
            try self.cancelTimerDecisionAttributes?.validate(name: "\(name).cancelTimerDecisionAttributes")
            try self.cancelWorkflowExecutionDecisionAttributes?.validate(name: "\(name).cancelWorkflowExecutionDecisionAttributes")
            try self.completeWorkflowExecutionDecisionAttributes?.validate(name: "\(name).completeWorkflowExecutionDecisionAttributes")
            try self.continueAsNewWorkflowExecutionDecisionAttributes?.validate(name: "\(name).continueAsNewWorkflowExecutionDecisionAttributes")
            try self.failWorkflowExecutionDecisionAttributes?.validate(name: "\(name).failWorkflowExecutionDecisionAttributes")
            try self.recordMarkerDecisionAttributes?.validate(name: "\(name).recordMarkerDecisionAttributes")
            try self.requestCancelActivityTaskDecisionAttributes?.validate(name: "\(name).requestCancelActivityTaskDecisionAttributes")
            try self.requestCancelExternalWorkflowExecutionDecisionAttributes?.validate(name: "\(name).requestCancelExternalWorkflowExecutionDecisionAttributes")
            try self.scheduleActivityTaskDecisionAttributes?.validate(name: "\(name).scheduleActivityTaskDecisionAttributes")
            try self.scheduleLambdaFunctionDecisionAttributes?.validate(name: "\(name).scheduleLambdaFunctionDecisionAttributes")
            try self.signalExternalWorkflowExecutionDecisionAttributes?.validate(name: "\(name).signalExternalWorkflowExecutionDecisionAttributes")
            try self.startChildWorkflowExecutionDecisionAttributes?.validate(name: "\(name).startChildWorkflowExecutionDecisionAttributes")
            try self.startTimerDecisionAttributes?.validate(name: "\(name).startTimerDecisionAttributes")
        }

        private enum CodingKeys: String, CodingKey {
            case cancelTimerDecisionAttributes
            case cancelWorkflowExecutionDecisionAttributes
            case completeWorkflowExecutionDecisionAttributes
            case continueAsNewWorkflowExecutionDecisionAttributes
            case decisionType
            case failWorkflowExecutionDecisionAttributes
            case recordMarkerDecisionAttributes
            case requestCancelActivityTaskDecisionAttributes
            case requestCancelExternalWorkflowExecutionDecisionAttributes
            case scheduleActivityTaskDecisionAttributes
            case scheduleLambdaFunctionDecisionAttributes
            case signalExternalWorkflowExecutionDecisionAttributes
            case startChildWorkflowExecutionDecisionAttributes
            case startTimerDecisionAttributes
        }
    }

    public struct DecisionTask: AWSDecodableShape {
        /// A paginated list of history events of the workflow execution. The decider uses this during the processing of the decision task.
        public let events: [HistoryEvent]
        /// If a NextPageToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextPageToken. Keep all other arguments unchanged. The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// The ID of the DecisionTaskStarted event of the previous decision task of this workflow execution that was processed by the decider. This can be used to determine the events in the history new since the last decision task received by the decider.
        public let previousStartedEventId: Int64?
        /// The ID of the DecisionTaskStarted event recorded in the history.
        public let startedEventId: Int64
        /// The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.
        public let taskToken: String
        /// The workflow execution for which this decision task was created.
        public let workflowExecution: WorkflowExecution
        /// The type of the workflow execution for which this decision task was created.
        public let workflowType: WorkflowType

        public init(events: [HistoryEvent], nextPageToken: String? = nil, previousStartedEventId: Int64? = nil, startedEventId: Int64, taskToken: String, workflowExecution: WorkflowExecution, workflowType: WorkflowType) {
            self.events = events
            self.nextPageToken = nextPageToken
            self.previousStartedEventId = previousStartedEventId
            self.startedEventId = startedEventId
            self.taskToken = taskToken
            self.workflowExecution = workflowExecution
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case events
            case nextPageToken
            case previousStartedEventId
            case startedEventId
            case taskToken
            case workflowExecution
            case workflowType
        }
    }

    public struct DecisionTaskCompletedEventAttributes: AWSDecodableShape {
        /// User defined context for the workflow execution.
        public let executionContext: String?
        /// The ID of the DecisionTaskScheduled event that was recorded when this decision task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the DecisionTaskStarted event recorded when this decision task was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64

        public init(executionContext: String? = nil, scheduledEventId: Int64, startedEventId: Int64) {
            self.executionContext = executionContext
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case executionContext
            case scheduledEventId
            case startedEventId
        }
    }

    public struct DecisionTaskScheduledEventAttributes: AWSDecodableShape {
        /// The maximum duration for this decision task. The task is considered timed out if it doesn't completed within this duration. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let startToCloseTimeout: String?
        /// The name of the task list in which the decision task was scheduled.
        public let taskList: TaskList
        ///  A task priority that, if set, specifies the priority for this decision task. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?

        public init(startToCloseTimeout: String? = nil, taskList: TaskList, taskPriority: String? = nil) {
            self.startToCloseTimeout = startToCloseTimeout
            self.taskList = taskList
            self.taskPriority = taskPriority
        }

        private enum CodingKeys: String, CodingKey {
            case startToCloseTimeout
            case taskList
            case taskPriority
        }
    }

    public struct DecisionTaskStartedEventAttributes: AWSDecodableShape {
        /// Identity of the decider making the request. This enables diagnostic tracing when problems arise. The form of this identity is user defined.
        public let identity: String?
        /// The ID of the DecisionTaskScheduled event that was recorded when this decision task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64

        public init(identity: String? = nil, scheduledEventId: Int64) {
            self.identity = identity
            self.scheduledEventId = scheduledEventId
        }

        private enum CodingKeys: String, CodingKey {
            case identity
            case scheduledEventId
        }
    }

    public struct DecisionTaskTimedOutEventAttributes: AWSDecodableShape {
        /// The ID of the DecisionTaskScheduled event that was recorded when this decision task was scheduled. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the DecisionTaskStarted event recorded when this decision task was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The type of timeout that expired before the decision task could be completed.
        public let timeoutType: DecisionTaskTimeoutType

        public init(scheduledEventId: Int64, startedEventId: Int64, timeoutType: DecisionTaskTimeoutType) {
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
            self.timeoutType = timeoutType
        }

        private enum CodingKeys: String, CodingKey {
            case scheduledEventId
            case startedEventId
            case timeoutType
        }
    }

    public struct DeprecateActivityTypeInput: AWSEncodableShape {
        /// The activity type to deprecate.
        public let activityType: ActivityType
        /// The name of the domain in which the activity type is registered.
        public let domain: String

        public init(activityType: ActivityType, domain: String) {
            self.activityType = activityType
            self.domain = domain
        }

        public func validate(name: String) throws {
            try self.activityType.validate(name: "\(name).activityType")
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case activityType
            case domain
        }
    }

    public struct DeprecateDomainInput: AWSEncodableShape {
        /// The name of the domain to deprecate.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct DeprecateWorkflowTypeInput: AWSEncodableShape {
        /// The name of the domain in which the workflow type is registered.
        public let domain: String
        /// The workflow type to deprecate.
        public let workflowType: WorkflowType

        public init(domain: String, workflowType: WorkflowType) {
            self.domain = domain
            self.workflowType = workflowType
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.workflowType.validate(name: "\(name).workflowType")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case workflowType
        }
    }

    public struct DescribeActivityTypeInput: AWSEncodableShape {
        /// The activity type to get information about. Activity types are identified by the name and version that were supplied when the activity was registered.
        public let activityType: ActivityType
        /// The name of the domain in which the activity type is registered.
        public let domain: String

        public init(activityType: ActivityType, domain: String) {
            self.activityType = activityType
            self.domain = domain
        }

        public func validate(name: String) throws {
            try self.activityType.validate(name: "\(name).activityType")
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case activityType
            case domain
        }
    }

    public struct DescribeDomainInput: AWSEncodableShape {
        /// The name of the domain to describe.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct DescribeWorkflowExecutionInput: AWSEncodableShape {
        /// The name of the domain containing the workflow execution.
        public let domain: String
        /// The workflow execution to describe.
        public let execution: WorkflowExecution

        public init(domain: String, execution: WorkflowExecution) {
            self.domain = domain
            self.execution = execution
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.execution.validate(name: "\(name).execution")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case execution
        }
    }

    public struct DescribeWorkflowTypeInput: AWSEncodableShape {
        /// The name of the domain in which this workflow type is registered.
        public let domain: String
        /// The workflow type to describe.
        public let workflowType: WorkflowType

        public init(domain: String, workflowType: WorkflowType) {
            self.domain = domain
            self.workflowType = workflowType
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.workflowType.validate(name: "\(name).workflowType")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case workflowType
        }
    }

    public struct DomainConfiguration: AWSDecodableShape {
        /// The retention period for workflow executions in this domain.
        public let workflowExecutionRetentionPeriodInDays: String

        public init(workflowExecutionRetentionPeriodInDays: String) {
            self.workflowExecutionRetentionPeriodInDays = workflowExecutionRetentionPeriodInDays
        }

        private enum CodingKeys: String, CodingKey {
            case workflowExecutionRetentionPeriodInDays
        }
    }

    public struct DomainDetail: AWSDecodableShape {
        /// The domain configuration. Currently, this includes only the domain's retention period.
        public let configuration: DomainConfiguration
        /// The basic information about a domain, such as its name, status, and description.
        public let domainInfo: DomainInfo

        public init(configuration: DomainConfiguration, domainInfo: DomainInfo) {
            self.configuration = configuration
            self.domainInfo = domainInfo
        }

        private enum CodingKeys: String, CodingKey {
            case configuration
            case domainInfo
        }
    }

    public struct DomainInfo: AWSDecodableShape {
        /// The ARN of the domain.
        public let arn: String?
        /// The description of the domain provided through RegisterDomain.
        public let description: String?
        /// The name of the domain. This name is unique within the account.
        public let name: String
        /// The status of the domain:    REGISTERED – The domain is properly registered and available. You can use this domain for registering types and creating new workflow executions.     DEPRECATED – The domain was deprecated using DeprecateDomain, but is still in use. You should not create new workflow executions in this domain.
        public let status: RegistrationStatus

        public init(arn: String? = nil, description: String? = nil, name: String, status: RegistrationStatus) {
            self.arn = arn
            self.description = description
            self.name = name
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case description
            case name
            case status
        }
    }

    public struct DomainInfos: AWSDecodableShape {
        /// A list of DomainInfo structures.
        public let domainInfos: [DomainInfo]
        /// If a NextPageToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextPageToken. Keep all other arguments unchanged. The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?

        public init(domainInfos: [DomainInfo], nextPageToken: String? = nil) {
            self.domainInfos = domainInfos
            self.nextPageToken = nextPageToken
        }

        private enum CodingKeys: String, CodingKey {
            case domainInfos
            case nextPageToken
        }
    }

    public struct ExecutionTimeFilter: AWSEncodableShape {
        /// Specifies the latest start or close date and time to return.
        public let latestDate: Date?
        /// Specifies the oldest start or close date and time to return.
        public let oldestDate: Date

        public init(latestDate: Date? = nil, oldestDate: Date) {
            self.latestDate = latestDate
            self.oldestDate = oldestDate
        }

        private enum CodingKeys: String, CodingKey {
            case latestDate
            case oldestDate
        }
    }

    public struct ExternalWorkflowExecutionCancelRequestedEventAttributes: AWSDecodableShape {
        /// The ID of the RequestCancelExternalWorkflowExecutionInitiated event corresponding to the RequestCancelExternalWorkflowExecution decision to cancel this external workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The external workflow execution to which the cancellation request was delivered.
        public let workflowExecution: WorkflowExecution

        public init(initiatedEventId: Int64, workflowExecution: WorkflowExecution) {
            self.initiatedEventId = initiatedEventId
            self.workflowExecution = workflowExecution
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedEventId
            case workflowExecution
        }
    }

    public struct ExternalWorkflowExecutionSignaledEventAttributes: AWSDecodableShape {
        /// The ID of the SignalExternalWorkflowExecutionInitiated event corresponding to the SignalExternalWorkflowExecution decision to request this signal. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The external workflow execution that the signal was delivered to.
        public let workflowExecution: WorkflowExecution

        public init(initiatedEventId: Int64, workflowExecution: WorkflowExecution) {
            self.initiatedEventId = initiatedEventId
            self.workflowExecution = workflowExecution
        }

        private enum CodingKeys: String, CodingKey {
            case initiatedEventId
            case workflowExecution
        }
    }

    public struct FailWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        ///  Details of the failure.
        public let details: String?
        /// A descriptive reason for the failure that may help in diagnostics.
        public let reason: String?

        public init(details: String? = nil, reason: String? = nil) {
            self.details = details
            self.reason = reason
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 32768)
            try self.validate(self.reason, name: "reason", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case reason
        }
    }

    public struct FailWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: FailWorkflowExecutionFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the FailWorkflowExecution decision to fail this execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(cause: FailWorkflowExecutionFailedCause, decisionTaskCompletedEventId: Int64) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
        }
    }

    public struct GetWorkflowExecutionHistoryInput: AWSEncodableShape {
        /// The name of the domain containing the workflow execution.
        public let domain: String
        /// Specifies the workflow execution for which to return the history.
        public let execution: WorkflowExecution
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.
        public let maximumPageSize: Int?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// When set to true, returns the events in reverse order. By default the results are returned in ascending order of the eventTimeStamp of the events.
        public let reverseOrder: Bool?

        public init(domain: String, execution: WorkflowExecution, maximumPageSize: Int? = nil, nextPageToken: String? = nil, reverseOrder: Bool? = nil) {
            self.domain = domain
            self.execution = execution
            self.maximumPageSize = maximumPageSize
            self.nextPageToken = nextPageToken
            self.reverseOrder = reverseOrder
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.execution.validate(name: "\(name).execution")
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case execution
            case maximumPageSize
            case nextPageToken
            case reverseOrder
        }
    }

    public struct History: AWSDecodableShape {
        /// The list of history events.
        public let events: [HistoryEvent]
        /// If a NextPageToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextPageToken. Keep all other arguments unchanged. The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?

        public init(events: [HistoryEvent], nextPageToken: String? = nil) {
            self.events = events
            self.nextPageToken = nextPageToken
        }

        private enum CodingKeys: String, CodingKey {
            case events
            case nextPageToken
        }
    }

    public struct HistoryEvent: AWSDecodableShape {
        /// If the event is of type ActivityTaskCanceled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskCanceledEventAttributes: ActivityTaskCanceledEventAttributes?
        /// If the event is of type ActivityTaskcancelRequested then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskCancelRequestedEventAttributes: ActivityTaskCancelRequestedEventAttributes?
        /// If the event is of type ActivityTaskCompleted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskCompletedEventAttributes: ActivityTaskCompletedEventAttributes?
        /// If the event is of type ActivityTaskFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskFailedEventAttributes: ActivityTaskFailedEventAttributes?
        /// If the event is of type ActivityTaskScheduled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskScheduledEventAttributes: ActivityTaskScheduledEventAttributes?
        /// If the event is of type ActivityTaskStarted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskStartedEventAttributes: ActivityTaskStartedEventAttributes?
        /// If the event is of type ActivityTaskTimedOut then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let activityTaskTimedOutEventAttributes: ActivityTaskTimedOutEventAttributes?
        /// If the event is of type CancelTimerFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let cancelTimerFailedEventAttributes: CancelTimerFailedEventAttributes?
        /// If the event is of type CancelWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let cancelWorkflowExecutionFailedEventAttributes: CancelWorkflowExecutionFailedEventAttributes?
        /// If the event is of type ChildWorkflowExecutionCanceled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let childWorkflowExecutionCanceledEventAttributes: ChildWorkflowExecutionCanceledEventAttributes?
        /// If the event is of type ChildWorkflowExecutionCompleted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let childWorkflowExecutionCompletedEventAttributes: ChildWorkflowExecutionCompletedEventAttributes?
        /// If the event is of type ChildWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let childWorkflowExecutionFailedEventAttributes: ChildWorkflowExecutionFailedEventAttributes?
        /// If the event is of type ChildWorkflowExecutionStarted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let childWorkflowExecutionStartedEventAttributes: ChildWorkflowExecutionStartedEventAttributes?
        /// If the event is of type ChildWorkflowExecutionTerminated then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let childWorkflowExecutionTerminatedEventAttributes: ChildWorkflowExecutionTerminatedEventAttributes?
        /// If the event is of type ChildWorkflowExecutionTimedOut then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let childWorkflowExecutionTimedOutEventAttributes: ChildWorkflowExecutionTimedOutEventAttributes?
        /// If the event is of type CompleteWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let completeWorkflowExecutionFailedEventAttributes: CompleteWorkflowExecutionFailedEventAttributes?
        /// If the event is of type ContinueAsNewWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let continueAsNewWorkflowExecutionFailedEventAttributes: ContinueAsNewWorkflowExecutionFailedEventAttributes?
        /// If the event is of type DecisionTaskCompleted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let decisionTaskCompletedEventAttributes: DecisionTaskCompletedEventAttributes?
        /// If the event is of type DecisionTaskScheduled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let decisionTaskScheduledEventAttributes: DecisionTaskScheduledEventAttributes?
        /// If the event is of type DecisionTaskStarted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let decisionTaskStartedEventAttributes: DecisionTaskStartedEventAttributes?
        /// If the event is of type DecisionTaskTimedOut then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let decisionTaskTimedOutEventAttributes: DecisionTaskTimedOutEventAttributes?
        /// The system generated ID of the event. This ID uniquely identifies the event with in the workflow execution history.
        public let eventId: Int64
        /// The date and time when the event occurred.
        public let eventTimestamp: Date
        /// The type of the history event.
        public let eventType: EventType
        /// If the event is of type ExternalWorkflowExecutionCancelRequested then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let externalWorkflowExecutionCancelRequestedEventAttributes: ExternalWorkflowExecutionCancelRequestedEventAttributes?
        /// If the event is of type ExternalWorkflowExecutionSignaled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let externalWorkflowExecutionSignaledEventAttributes: ExternalWorkflowExecutionSignaledEventAttributes?
        /// If the event is of type FailWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let failWorkflowExecutionFailedEventAttributes: FailWorkflowExecutionFailedEventAttributes?
        /// Provides the details of the LambdaFunctionCompleted event. It isn't set for other event types.
        public let lambdaFunctionCompletedEventAttributes: LambdaFunctionCompletedEventAttributes?
        /// Provides the details of the LambdaFunctionFailed event. It isn't set for other event types.
        public let lambdaFunctionFailedEventAttributes: LambdaFunctionFailedEventAttributes?
        /// Provides the details of the LambdaFunctionScheduled event. It isn't set for other event types.
        public let lambdaFunctionScheduledEventAttributes: LambdaFunctionScheduledEventAttributes?
        /// Provides the details of the LambdaFunctionStarted event. It isn't set for other event types.
        public let lambdaFunctionStartedEventAttributes: LambdaFunctionStartedEventAttributes?
        /// Provides the details of the LambdaFunctionTimedOut event. It isn't set for other event types.
        public let lambdaFunctionTimedOutEventAttributes: LambdaFunctionTimedOutEventAttributes?
        /// If the event is of type MarkerRecorded then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let markerRecordedEventAttributes: MarkerRecordedEventAttributes?
        /// If the event is of type DecisionTaskFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let recordMarkerFailedEventAttributes: RecordMarkerFailedEventAttributes?
        /// If the event is of type RequestCancelActivityTaskFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let requestCancelActivityTaskFailedEventAttributes: RequestCancelActivityTaskFailedEventAttributes?
        /// If the event is of type RequestCancelExternalWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let requestCancelExternalWorkflowExecutionFailedEventAttributes: RequestCancelExternalWorkflowExecutionFailedEventAttributes?
        /// If the event is of type RequestCancelExternalWorkflowExecutionInitiated then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let requestCancelExternalWorkflowExecutionInitiatedEventAttributes: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes?
        /// If the event is of type ScheduleActivityTaskFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let scheduleActivityTaskFailedEventAttributes: ScheduleActivityTaskFailedEventAttributes?
        /// Provides the details of the ScheduleLambdaFunctionFailed event. It isn't set for other event types.
        public let scheduleLambdaFunctionFailedEventAttributes: ScheduleLambdaFunctionFailedEventAttributes?
        /// If the event is of type SignalExternalWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let signalExternalWorkflowExecutionFailedEventAttributes: SignalExternalWorkflowExecutionFailedEventAttributes?
        /// If the event is of type SignalExternalWorkflowExecutionInitiated then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let signalExternalWorkflowExecutionInitiatedEventAttributes: SignalExternalWorkflowExecutionInitiatedEventAttributes?
        /// If the event is of type StartChildWorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let startChildWorkflowExecutionFailedEventAttributes: StartChildWorkflowExecutionFailedEventAttributes?
        /// If the event is of type StartChildWorkflowExecutionInitiated then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let startChildWorkflowExecutionInitiatedEventAttributes: StartChildWorkflowExecutionInitiatedEventAttributes?
        /// Provides the details of the StartLambdaFunctionFailed event. It isn't set for other event types.
        public let startLambdaFunctionFailedEventAttributes: StartLambdaFunctionFailedEventAttributes?
        /// If the event is of type StartTimerFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let startTimerFailedEventAttributes: StartTimerFailedEventAttributes?
        /// If the event is of type TimerCanceled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let timerCanceledEventAttributes: TimerCanceledEventAttributes?
        /// If the event is of type TimerFired then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let timerFiredEventAttributes: TimerFiredEventAttributes?
        /// If the event is of type TimerStarted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let timerStartedEventAttributes: TimerStartedEventAttributes?
        /// If the event is of type WorkflowExecutionCanceled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionCanceledEventAttributes: WorkflowExecutionCanceledEventAttributes?
        /// If the event is of type WorkflowExecutionCancelRequested then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionCancelRequestedEventAttributes: WorkflowExecutionCancelRequestedEventAttributes?
        /// If the event is of type WorkflowExecutionCompleted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionCompletedEventAttributes: WorkflowExecutionCompletedEventAttributes?
        /// If the event is of type WorkflowExecutionContinuedAsNew then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionContinuedAsNewEventAttributes: WorkflowExecutionContinuedAsNewEventAttributes?
        /// If the event is of type WorkflowExecutionFailed then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionFailedEventAttributes: WorkflowExecutionFailedEventAttributes?
        /// If the event is of type WorkflowExecutionSignaled then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionSignaledEventAttributes: WorkflowExecutionSignaledEventAttributes?
        /// If the event is of type WorkflowExecutionStarted then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionStartedEventAttributes: WorkflowExecutionStartedEventAttributes?
        /// If the event is of type WorkflowExecutionTerminated then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionTerminatedEventAttributes: WorkflowExecutionTerminatedEventAttributes?
        /// If the event is of type WorkflowExecutionTimedOut then this member is set and provides detailed information about the event. It isn't set for other event types.
        public let workflowExecutionTimedOutEventAttributes: WorkflowExecutionTimedOutEventAttributes?

        public init(activityTaskCanceledEventAttributes: ActivityTaskCanceledEventAttributes? = nil, activityTaskCancelRequestedEventAttributes: ActivityTaskCancelRequestedEventAttributes? = nil, activityTaskCompletedEventAttributes: ActivityTaskCompletedEventAttributes? = nil, activityTaskFailedEventAttributes: ActivityTaskFailedEventAttributes? = nil, activityTaskScheduledEventAttributes: ActivityTaskScheduledEventAttributes? = nil, activityTaskStartedEventAttributes: ActivityTaskStartedEventAttributes? = nil, activityTaskTimedOutEventAttributes: ActivityTaskTimedOutEventAttributes? = nil, cancelTimerFailedEventAttributes: CancelTimerFailedEventAttributes? = nil, cancelWorkflowExecutionFailedEventAttributes: CancelWorkflowExecutionFailedEventAttributes? = nil, childWorkflowExecutionCanceledEventAttributes: ChildWorkflowExecutionCanceledEventAttributes? = nil, childWorkflowExecutionCompletedEventAttributes: ChildWorkflowExecutionCompletedEventAttributes? = nil, childWorkflowExecutionFailedEventAttributes: ChildWorkflowExecutionFailedEventAttributes? = nil, childWorkflowExecutionStartedEventAttributes: ChildWorkflowExecutionStartedEventAttributes? = nil, childWorkflowExecutionTerminatedEventAttributes: ChildWorkflowExecutionTerminatedEventAttributes? = nil, childWorkflowExecutionTimedOutEventAttributes: ChildWorkflowExecutionTimedOutEventAttributes? = nil, completeWorkflowExecutionFailedEventAttributes: CompleteWorkflowExecutionFailedEventAttributes? = nil, continueAsNewWorkflowExecutionFailedEventAttributes: ContinueAsNewWorkflowExecutionFailedEventAttributes? = nil, decisionTaskCompletedEventAttributes: DecisionTaskCompletedEventAttributes? = nil, decisionTaskScheduledEventAttributes: DecisionTaskScheduledEventAttributes? = nil, decisionTaskStartedEventAttributes: DecisionTaskStartedEventAttributes? = nil, decisionTaskTimedOutEventAttributes: DecisionTaskTimedOutEventAttributes? = nil, eventId: Int64, eventTimestamp: Date, eventType: EventType, externalWorkflowExecutionCancelRequestedEventAttributes: ExternalWorkflowExecutionCancelRequestedEventAttributes? = nil, externalWorkflowExecutionSignaledEventAttributes: ExternalWorkflowExecutionSignaledEventAttributes? = nil, failWorkflowExecutionFailedEventAttributes: FailWorkflowExecutionFailedEventAttributes? = nil, lambdaFunctionCompletedEventAttributes: LambdaFunctionCompletedEventAttributes? = nil, lambdaFunctionFailedEventAttributes: LambdaFunctionFailedEventAttributes? = nil, lambdaFunctionScheduledEventAttributes: LambdaFunctionScheduledEventAttributes? = nil, lambdaFunctionStartedEventAttributes: LambdaFunctionStartedEventAttributes? = nil, lambdaFunctionTimedOutEventAttributes: LambdaFunctionTimedOutEventAttributes? = nil, markerRecordedEventAttributes: MarkerRecordedEventAttributes? = nil, recordMarkerFailedEventAttributes: RecordMarkerFailedEventAttributes? = nil, requestCancelActivityTaskFailedEventAttributes: RequestCancelActivityTaskFailedEventAttributes? = nil, requestCancelExternalWorkflowExecutionFailedEventAttributes: RequestCancelExternalWorkflowExecutionFailedEventAttributes? = nil, requestCancelExternalWorkflowExecutionInitiatedEventAttributes: RequestCancelExternalWorkflowExecutionInitiatedEventAttributes? = nil, scheduleActivityTaskFailedEventAttributes: ScheduleActivityTaskFailedEventAttributes? = nil, scheduleLambdaFunctionFailedEventAttributes: ScheduleLambdaFunctionFailedEventAttributes? = nil, signalExternalWorkflowExecutionFailedEventAttributes: SignalExternalWorkflowExecutionFailedEventAttributes? = nil, signalExternalWorkflowExecutionInitiatedEventAttributes: SignalExternalWorkflowExecutionInitiatedEventAttributes? = nil, startChildWorkflowExecutionFailedEventAttributes: StartChildWorkflowExecutionFailedEventAttributes? = nil, startChildWorkflowExecutionInitiatedEventAttributes: StartChildWorkflowExecutionInitiatedEventAttributes? = nil, startLambdaFunctionFailedEventAttributes: StartLambdaFunctionFailedEventAttributes? = nil, startTimerFailedEventAttributes: StartTimerFailedEventAttributes? = nil, timerCanceledEventAttributes: TimerCanceledEventAttributes? = nil, timerFiredEventAttributes: TimerFiredEventAttributes? = nil, timerStartedEventAttributes: TimerStartedEventAttributes? = nil, workflowExecutionCanceledEventAttributes: WorkflowExecutionCanceledEventAttributes? = nil, workflowExecutionCancelRequestedEventAttributes: WorkflowExecutionCancelRequestedEventAttributes? = nil, workflowExecutionCompletedEventAttributes: WorkflowExecutionCompletedEventAttributes? = nil, workflowExecutionContinuedAsNewEventAttributes: WorkflowExecutionContinuedAsNewEventAttributes? = nil, workflowExecutionFailedEventAttributes: WorkflowExecutionFailedEventAttributes? = nil, workflowExecutionSignaledEventAttributes: WorkflowExecutionSignaledEventAttributes? = nil, workflowExecutionStartedEventAttributes: WorkflowExecutionStartedEventAttributes? = nil, workflowExecutionTerminatedEventAttributes: WorkflowExecutionTerminatedEventAttributes? = nil, workflowExecutionTimedOutEventAttributes: WorkflowExecutionTimedOutEventAttributes? = nil) {
            self.activityTaskCanceledEventAttributes = activityTaskCanceledEventAttributes
            self.activityTaskCancelRequestedEventAttributes = activityTaskCancelRequestedEventAttributes
            self.activityTaskCompletedEventAttributes = activityTaskCompletedEventAttributes
            self.activityTaskFailedEventAttributes = activityTaskFailedEventAttributes
            self.activityTaskScheduledEventAttributes = activityTaskScheduledEventAttributes
            self.activityTaskStartedEventAttributes = activityTaskStartedEventAttributes
            self.activityTaskTimedOutEventAttributes = activityTaskTimedOutEventAttributes
            self.cancelTimerFailedEventAttributes = cancelTimerFailedEventAttributes
            self.cancelWorkflowExecutionFailedEventAttributes = cancelWorkflowExecutionFailedEventAttributes
            self.childWorkflowExecutionCanceledEventAttributes = childWorkflowExecutionCanceledEventAttributes
            self.childWorkflowExecutionCompletedEventAttributes = childWorkflowExecutionCompletedEventAttributes
            self.childWorkflowExecutionFailedEventAttributes = childWorkflowExecutionFailedEventAttributes
            self.childWorkflowExecutionStartedEventAttributes = childWorkflowExecutionStartedEventAttributes
            self.childWorkflowExecutionTerminatedEventAttributes = childWorkflowExecutionTerminatedEventAttributes
            self.childWorkflowExecutionTimedOutEventAttributes = childWorkflowExecutionTimedOutEventAttributes
            self.completeWorkflowExecutionFailedEventAttributes = completeWorkflowExecutionFailedEventAttributes
            self.continueAsNewWorkflowExecutionFailedEventAttributes = continueAsNewWorkflowExecutionFailedEventAttributes
            self.decisionTaskCompletedEventAttributes = decisionTaskCompletedEventAttributes
            self.decisionTaskScheduledEventAttributes = decisionTaskScheduledEventAttributes
            self.decisionTaskStartedEventAttributes = decisionTaskStartedEventAttributes
            self.decisionTaskTimedOutEventAttributes = decisionTaskTimedOutEventAttributes
            self.eventId = eventId
            self.eventTimestamp = eventTimestamp
            self.eventType = eventType
            self.externalWorkflowExecutionCancelRequestedEventAttributes = externalWorkflowExecutionCancelRequestedEventAttributes
            self.externalWorkflowExecutionSignaledEventAttributes = externalWorkflowExecutionSignaledEventAttributes
            self.failWorkflowExecutionFailedEventAttributes = failWorkflowExecutionFailedEventAttributes
            self.lambdaFunctionCompletedEventAttributes = lambdaFunctionCompletedEventAttributes
            self.lambdaFunctionFailedEventAttributes = lambdaFunctionFailedEventAttributes
            self.lambdaFunctionScheduledEventAttributes = lambdaFunctionScheduledEventAttributes
            self.lambdaFunctionStartedEventAttributes = lambdaFunctionStartedEventAttributes
            self.lambdaFunctionTimedOutEventAttributes = lambdaFunctionTimedOutEventAttributes
            self.markerRecordedEventAttributes = markerRecordedEventAttributes
            self.recordMarkerFailedEventAttributes = recordMarkerFailedEventAttributes
            self.requestCancelActivityTaskFailedEventAttributes = requestCancelActivityTaskFailedEventAttributes
            self.requestCancelExternalWorkflowExecutionFailedEventAttributes = requestCancelExternalWorkflowExecutionFailedEventAttributes
            self.requestCancelExternalWorkflowExecutionInitiatedEventAttributes = requestCancelExternalWorkflowExecutionInitiatedEventAttributes
            self.scheduleActivityTaskFailedEventAttributes = scheduleActivityTaskFailedEventAttributes
            self.scheduleLambdaFunctionFailedEventAttributes = scheduleLambdaFunctionFailedEventAttributes
            self.signalExternalWorkflowExecutionFailedEventAttributes = signalExternalWorkflowExecutionFailedEventAttributes
            self.signalExternalWorkflowExecutionInitiatedEventAttributes = signalExternalWorkflowExecutionInitiatedEventAttributes
            self.startChildWorkflowExecutionFailedEventAttributes = startChildWorkflowExecutionFailedEventAttributes
            self.startChildWorkflowExecutionInitiatedEventAttributes = startChildWorkflowExecutionInitiatedEventAttributes
            self.startLambdaFunctionFailedEventAttributes = startLambdaFunctionFailedEventAttributes
            self.startTimerFailedEventAttributes = startTimerFailedEventAttributes
            self.timerCanceledEventAttributes = timerCanceledEventAttributes
            self.timerFiredEventAttributes = timerFiredEventAttributes
            self.timerStartedEventAttributes = timerStartedEventAttributes
            self.workflowExecutionCanceledEventAttributes = workflowExecutionCanceledEventAttributes
            self.workflowExecutionCancelRequestedEventAttributes = workflowExecutionCancelRequestedEventAttributes
            self.workflowExecutionCompletedEventAttributes = workflowExecutionCompletedEventAttributes
            self.workflowExecutionContinuedAsNewEventAttributes = workflowExecutionContinuedAsNewEventAttributes
            self.workflowExecutionFailedEventAttributes = workflowExecutionFailedEventAttributes
            self.workflowExecutionSignaledEventAttributes = workflowExecutionSignaledEventAttributes
            self.workflowExecutionStartedEventAttributes = workflowExecutionStartedEventAttributes
            self.workflowExecutionTerminatedEventAttributes = workflowExecutionTerminatedEventAttributes
            self.workflowExecutionTimedOutEventAttributes = workflowExecutionTimedOutEventAttributes
        }

        private enum CodingKeys: String, CodingKey {
            case activityTaskCanceledEventAttributes
            case activityTaskCancelRequestedEventAttributes
            case activityTaskCompletedEventAttributes
            case activityTaskFailedEventAttributes
            case activityTaskScheduledEventAttributes
            case activityTaskStartedEventAttributes
            case activityTaskTimedOutEventAttributes
            case cancelTimerFailedEventAttributes
            case cancelWorkflowExecutionFailedEventAttributes
            case childWorkflowExecutionCanceledEventAttributes
            case childWorkflowExecutionCompletedEventAttributes
            case childWorkflowExecutionFailedEventAttributes
            case childWorkflowExecutionStartedEventAttributes
            case childWorkflowExecutionTerminatedEventAttributes
            case childWorkflowExecutionTimedOutEventAttributes
            case completeWorkflowExecutionFailedEventAttributes
            case continueAsNewWorkflowExecutionFailedEventAttributes
            case decisionTaskCompletedEventAttributes
            case decisionTaskScheduledEventAttributes
            case decisionTaskStartedEventAttributes
            case decisionTaskTimedOutEventAttributes
            case eventId
            case eventTimestamp
            case eventType
            case externalWorkflowExecutionCancelRequestedEventAttributes
            case externalWorkflowExecutionSignaledEventAttributes
            case failWorkflowExecutionFailedEventAttributes
            case lambdaFunctionCompletedEventAttributes
            case lambdaFunctionFailedEventAttributes
            case lambdaFunctionScheduledEventAttributes
            case lambdaFunctionStartedEventAttributes
            case lambdaFunctionTimedOutEventAttributes
            case markerRecordedEventAttributes
            case recordMarkerFailedEventAttributes
            case requestCancelActivityTaskFailedEventAttributes
            case requestCancelExternalWorkflowExecutionFailedEventAttributes
            case requestCancelExternalWorkflowExecutionInitiatedEventAttributes
            case scheduleActivityTaskFailedEventAttributes
            case scheduleLambdaFunctionFailedEventAttributes
            case signalExternalWorkflowExecutionFailedEventAttributes
            case signalExternalWorkflowExecutionInitiatedEventAttributes
            case startChildWorkflowExecutionFailedEventAttributes
            case startChildWorkflowExecutionInitiatedEventAttributes
            case startLambdaFunctionFailedEventAttributes
            case startTimerFailedEventAttributes
            case timerCanceledEventAttributes
            case timerFiredEventAttributes
            case timerStartedEventAttributes
            case workflowExecutionCanceledEventAttributes
            case workflowExecutionCancelRequestedEventAttributes
            case workflowExecutionCompletedEventAttributes
            case workflowExecutionContinuedAsNewEventAttributes
            case workflowExecutionFailedEventAttributes
            case workflowExecutionSignaledEventAttributes
            case workflowExecutionStartedEventAttributes
            case workflowExecutionTerminatedEventAttributes
            case workflowExecutionTimedOutEventAttributes
        }
    }

    public struct LambdaFunctionCompletedEventAttributes: AWSDecodableShape {
        /// The results of the Lambda task.
        public let result: String?
        /// The ID of the LambdaFunctionScheduled event that was recorded when this Lambda task was scheduled. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the LambdaFunctionStarted event recorded when this activity task started. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let startedEventId: Int64

        public init(result: String? = nil, scheduledEventId: Int64, startedEventId: Int64) {
            self.result = result
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case result
            case scheduledEventId
            case startedEventId
        }
    }

    public struct LambdaFunctionFailedEventAttributes: AWSDecodableShape {
        /// The details of the failure.
        public let details: String?
        /// The reason provided for the failure.
        public let reason: String?
        /// The ID of the LambdaFunctionScheduled event that was recorded when this activity task was scheduled. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the LambdaFunctionStarted event recorded when this activity task started. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let startedEventId: Int64

        public init(details: String? = nil, reason: String? = nil, scheduledEventId: Int64, startedEventId: Int64) {
            self.details = details
            self.reason = reason
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case reason
            case scheduledEventId
            case startedEventId
        }
    }

    public struct LambdaFunctionScheduledEventAttributes: AWSDecodableShape {
        /// Data attached to the event that the decider can use in subsequent workflow tasks. This data isn't sent to the Lambda task.
        public let control: String?
        /// The ID of the LambdaFunctionCompleted event corresponding to the decision that resulted in scheduling this activity task. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The unique ID of the Lambda task.
        public let id: String
        /// The input provided to the Lambda task.
        public let input: String?
        /// The name of the Lambda function.
        public let name: String
        /// The maximum amount of time a worker can take to process the Lambda task.
        public let startToCloseTimeout: String?

        public init(control: String? = nil, decisionTaskCompletedEventId: Int64, id: String, input: String? = nil, name: String, startToCloseTimeout: String? = nil) {
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.id = id
            self.input = input
            self.name = name
            self.startToCloseTimeout = startToCloseTimeout
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case decisionTaskCompletedEventId
            case id
            case input
            case name
            case startToCloseTimeout
        }
    }

    public struct LambdaFunctionStartedEventAttributes: AWSDecodableShape {
        /// The ID of the LambdaFunctionScheduled event that was recorded when this activity task was scheduled. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let scheduledEventId: Int64

        public init(scheduledEventId: Int64) {
            self.scheduledEventId = scheduledEventId
        }

        private enum CodingKeys: String, CodingKey {
            case scheduledEventId
        }
    }

    public struct LambdaFunctionTimedOutEventAttributes: AWSDecodableShape {
        /// The ID of the LambdaFunctionScheduled event that was recorded when this activity task was scheduled. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let scheduledEventId: Int64
        /// The ID of the ActivityTaskStarted event that was recorded when this activity task started. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The type of the timeout that caused this event.
        public let timeoutType: LambdaFunctionTimeoutType?

        public init(scheduledEventId: Int64, startedEventId: Int64, timeoutType: LambdaFunctionTimeoutType? = nil) {
            self.scheduledEventId = scheduledEventId
            self.startedEventId = startedEventId
            self.timeoutType = timeoutType
        }

        private enum CodingKeys: String, CodingKey {
            case scheduledEventId
            case startedEventId
            case timeoutType
        }
    }

    public struct ListActivityTypesInput: AWSEncodableShape {
        /// The name of the domain in which the activity types have been registered.
        public let domain: String
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.
        public let maximumPageSize: Int?
        /// If specified, only lists the activity types that have this name.
        public let name: String?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// Specifies the registration status of the activity types to list.
        public let registrationStatus: RegistrationStatus
        /// When set to true, returns the results in reverse order. By default, the results are returned in ascending alphabetical order by name of the activity types.
        public let reverseOrder: Bool?

        public init(domain: String, maximumPageSize: Int? = nil, name: String? = nil, nextPageToken: String? = nil, registrationStatus: RegistrationStatus, reverseOrder: Bool? = nil) {
            self.domain = domain
            self.maximumPageSize = maximumPageSize
            self.name = name
            self.nextPageToken = nextPageToken
            self.registrationStatus = registrationStatus
            self.reverseOrder = reverseOrder
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case maximumPageSize
            case name
            case nextPageToken
            case registrationStatus
            case reverseOrder
        }
    }

    public struct ListClosedWorkflowExecutionsInput: AWSEncodableShape {
        /// If specified, only workflow executions that match this close status are listed. For example, if TERMINATED is specified, then only TERMINATED workflow executions are listed.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let closeStatusFilter: CloseStatusFilter?
        /// If specified, the workflow executions are included in the returned results based on whether their close times are within the range specified by this filter. Also, if this parameter is specified, the returned results are ordered by their close times.   startTimeFilter and closeTimeFilter are mutually exclusive. You must specify one of these in a request but not both.
        public let closeTimeFilter: ExecutionTimeFilter?
        /// The name of the domain that contains the workflow executions to list.
        public let domain: String
        /// If specified, only workflow executions matching the workflow ID specified in the filter are returned.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let executionFilter: WorkflowExecutionFilter?
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.
        public let maximumPageSize: Int?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// When set to true, returns the results in reverse order. By default the results are returned in descending order of the start or the close time of the executions.
        public let reverseOrder: Bool?
        /// If specified, the workflow executions are included in the returned results based on whether their start times are within the range specified by this filter. Also, if this parameter is specified, the returned results are ordered by their start times.   startTimeFilter and closeTimeFilter are mutually exclusive. You must specify one of these in a request but not both.
        public let startTimeFilter: ExecutionTimeFilter?
        /// If specified, only executions that have the matching tag are listed.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let tagFilter: TagFilter?
        /// If specified, only executions of the type specified in the filter are returned.   closeStatusFilter, executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let typeFilter: WorkflowTypeFilter?

        public init(closeStatusFilter: CloseStatusFilter? = nil, closeTimeFilter: ExecutionTimeFilter? = nil, domain: String, executionFilter: WorkflowExecutionFilter? = nil, maximumPageSize: Int? = nil, nextPageToken: String? = nil, reverseOrder: Bool? = nil, startTimeFilter: ExecutionTimeFilter? = nil, tagFilter: TagFilter? = nil, typeFilter: WorkflowTypeFilter? = nil) {
            self.closeStatusFilter = closeStatusFilter
            self.closeTimeFilter = closeTimeFilter
            self.domain = domain
            self.executionFilter = executionFilter
            self.maximumPageSize = maximumPageSize
            self.nextPageToken = nextPageToken
            self.reverseOrder = reverseOrder
            self.startTimeFilter = startTimeFilter
            self.tagFilter = tagFilter
            self.typeFilter = typeFilter
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.executionFilter?.validate(name: "\(name).executionFilter")
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
            try self.tagFilter?.validate(name: "\(name).tagFilter")
            try self.typeFilter?.validate(name: "\(name).typeFilter")
        }

        private enum CodingKeys: String, CodingKey {
            case closeStatusFilter
            case closeTimeFilter
            case domain
            case executionFilter
            case maximumPageSize
            case nextPageToken
            case reverseOrder
            case startTimeFilter
            case tagFilter
            case typeFilter
        }
    }

    public struct ListDomainsInput: AWSEncodableShape {
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.
        public let maximumPageSize: Int?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// Specifies the registration status of the domains to list.
        public let registrationStatus: RegistrationStatus
        /// When set to true, returns the results in reverse order. By default, the results are returned in ascending alphabetical order by name of the domains.
        public let reverseOrder: Bool?

        public init(maximumPageSize: Int? = nil, nextPageToken: String? = nil, registrationStatus: RegistrationStatus, reverseOrder: Bool? = nil) {
            self.maximumPageSize = maximumPageSize
            self.nextPageToken = nextPageToken
            self.registrationStatus = registrationStatus
            self.reverseOrder = reverseOrder
        }

        public func validate(name: String) throws {
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
        }

        private enum CodingKeys: String, CodingKey {
            case maximumPageSize
            case nextPageToken
            case registrationStatus
            case reverseOrder
        }
    }

    public struct ListOpenWorkflowExecutionsInput: AWSEncodableShape {
        /// The name of the domain that contains the workflow executions to list.
        public let domain: String
        /// If specified, only workflow executions matching the workflow ID specified in the filter are returned.   executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let executionFilter: WorkflowExecutionFilter?
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.
        public let maximumPageSize: Int?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// When set to true, returns the results in reverse order. By default the results are returned in descending order of the start time of the executions.
        public let reverseOrder: Bool?
        /// Workflow executions are included in the returned results based on whether their start times are within the range specified by this filter.
        public let startTimeFilter: ExecutionTimeFilter
        /// If specified, only executions that have the matching tag are listed.   executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let tagFilter: TagFilter?
        /// If specified, only executions of the type specified in the filter are returned.   executionFilter, typeFilter and tagFilter are mutually exclusive. You can specify at most one of these in a request.
        public let typeFilter: WorkflowTypeFilter?

        public init(domain: String, executionFilter: WorkflowExecutionFilter? = nil, maximumPageSize: Int? = nil, nextPageToken: String? = nil, reverseOrder: Bool? = nil, startTimeFilter: ExecutionTimeFilter, tagFilter: TagFilter? = nil, typeFilter: WorkflowTypeFilter? = nil) {
            self.domain = domain
            self.executionFilter = executionFilter
            self.maximumPageSize = maximumPageSize
            self.nextPageToken = nextPageToken
            self.reverseOrder = reverseOrder
            self.startTimeFilter = startTimeFilter
            self.tagFilter = tagFilter
            self.typeFilter = typeFilter
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.executionFilter?.validate(name: "\(name).executionFilter")
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
            try self.tagFilter?.validate(name: "\(name).tagFilter")
            try self.typeFilter?.validate(name: "\(name).typeFilter")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case executionFilter
            case maximumPageSize
            case nextPageToken
            case reverseOrder
            case startTimeFilter
            case tagFilter
            case typeFilter
        }
    }

    public struct ListTagsForResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the Amazon SWF domain.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
        }
    }

    public struct ListTagsForResourceOutput: AWSDecodableShape {
        /// An array of tags associated with the domain.
        public let tags: [ResourceTag]?

        public init(tags: [ResourceTag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct ListWorkflowTypesInput: AWSEncodableShape {
        /// The name of the domain in which the workflow types have been registered.
        public let domain: String
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.
        public let maximumPageSize: Int?
        /// If specified, lists the workflow type with this name.
        public let name: String?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// Specifies the registration status of the workflow types to list.
        public let registrationStatus: RegistrationStatus
        /// When set to true, returns the results in reverse order. By default the results are returned in ascending alphabetical order of the name of the workflow types.
        public let reverseOrder: Bool?

        public init(domain: String, maximumPageSize: Int? = nil, name: String? = nil, nextPageToken: String? = nil, registrationStatus: RegistrationStatus, reverseOrder: Bool? = nil) {
            self.domain = domain
            self.maximumPageSize = maximumPageSize
            self.name = name
            self.nextPageToken = nextPageToken
            self.registrationStatus = registrationStatus
            self.reverseOrder = reverseOrder
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case maximumPageSize
            case name
            case nextPageToken
            case registrationStatus
            case reverseOrder
        }
    }

    public struct MarkerRecordedEventAttributes: AWSDecodableShape {
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the RecordMarker decision that requested this marker. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The details of the marker.
        public let details: String?
        /// The name of the marker.
        public let markerName: String

        public init(decisionTaskCompletedEventId: Int64, details: String? = nil, markerName: String) {
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.details = details
            self.markerName = markerName
        }

        private enum CodingKeys: String, CodingKey {
            case decisionTaskCompletedEventId
            case details
            case markerName
        }
    }

    public struct PendingTaskCount: AWSDecodableShape {
        /// The number of tasks in the task list.
        public let count: Int
        /// If set to true, indicates that the actual count was more than the maximum supported by this API and the count returned is the truncated value.
        public let truncated: Bool?

        public init(count: Int, truncated: Bool? = nil) {
            self.count = count
            self.truncated = truncated
        }

        private enum CodingKeys: String, CodingKey {
            case count
            case truncated
        }
    }

    public struct PollForActivityTaskInput: AWSEncodableShape {
        /// The name of the domain that contains the task lists being polled.
        public let domain: String
        /// Identity of the worker making the request, recorded in the ActivityTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.
        public let identity: String?
        /// Specifies the task list to poll for activity tasks. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let taskList: TaskList

        public init(domain: String, identity: String? = nil, taskList: TaskList) {
            self.domain = domain
            self.identity = identity
            self.taskList = taskList
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.identity, name: "identity", parent: name, max: 256)
            try self.taskList.validate(name: "\(name).taskList")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case identity
            case taskList
        }
    }

    public struct PollForDecisionTaskInput: AWSEncodableShape {
        /// The name of the domain containing the task lists to poll.
        public let domain: String
        /// Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.
        public let identity: String?
        /// The maximum number of results that are returned per call. Use nextPageToken to obtain further pages of results.  This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.
        public let maximumPageSize: Int?
        /// If NextPageToken is returned there are more results available. The value of NextPageToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 60 seconds. Using an expired pagination token will return a 400 error: "Specified token has exceeded its maximum lifetime".  The configured maximumPageSize determines how many results can be returned in a single call.   The nextPageToken returned by this action cannot be used with GetWorkflowExecutionHistory to get the next page. You must call PollForDecisionTask again (with the nextPageToken) to retrieve the next page of history records. Calling PollForDecisionTask with a nextPageToken doesn't return a new decision task.
        public let nextPageToken: String?
        /// When set to true, returns the events in reverse order. By default the results are returned in ascending order of the eventTimestamp of the events.
        public let reverseOrder: Bool?
        /// Specifies the task list to poll for decision tasks. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let taskList: TaskList

        public init(domain: String, identity: String? = nil, maximumPageSize: Int? = nil, nextPageToken: String? = nil, reverseOrder: Bool? = nil, taskList: TaskList) {
            self.domain = domain
            self.identity = identity
            self.maximumPageSize = maximumPageSize
            self.nextPageToken = nextPageToken
            self.reverseOrder = reverseOrder
            self.taskList = taskList
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.identity, name: "identity", parent: name, max: 256)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, max: 1000)
            try self.validate(self.maximumPageSize, name: "maximumPageSize", parent: name, min: 0)
            try self.validate(self.nextPageToken, name: "nextPageToken", parent: name, max: 2048)
            try self.taskList.validate(name: "\(name).taskList")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case identity
            case maximumPageSize
            case nextPageToken
            case reverseOrder
            case taskList
        }
    }

    public struct RecordActivityTaskHeartbeatInput: AWSEncodableShape {
        /// If specified, contains details about the progress of the task.
        public let details: String?
        /// The taskToken of the ActivityTask.   taskToken is generated by the service and should be treated as an opaque value. If the task is passed to another process, its taskToken must also be passed. This enables it to provide its progress and respond with results.
        public let taskToken: String

        public init(details: String? = nil, taskToken: String) {
            self.details = details
            self.taskToken = taskToken
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 2048)
            try self.validate(self.taskToken, name: "taskToken", parent: name, max: 1024)
            try self.validate(self.taskToken, name: "taskToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case taskToken
        }
    }

    public struct RecordMarkerDecisionAttributes: AWSEncodableShape {
        ///  The details of the marker.
        public let details: String?
        ///  The name of the marker.
        public let markerName: String

        public init(details: String? = nil, markerName: String) {
            self.details = details
            self.markerName = markerName
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 32768)
            try self.validate(self.markerName, name: "markerName", parent: name, max: 256)
            try self.validate(self.markerName, name: "markerName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case markerName
        }
    }

    public struct RecordMarkerFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: RecordMarkerFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the RecordMarkerFailed decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The marker's name.
        public let markerName: String

        public init(cause: RecordMarkerFailedCause, decisionTaskCompletedEventId: Int64, markerName: String) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.markerName = markerName
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
            case markerName
        }
    }

    public struct RegisterActivityTypeInput: AWSEncodableShape {
        /// If set, specifies the default maximum time before which a worker processing a task of this type must report progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically timed out. This default can be overridden when scheduling an activity task using the ScheduleActivityTask Decision. If the activity worker subsequently attempts to record a heartbeat or returns a result, the activity worker receives an UnknownResource fault. In this case, Amazon SWF no longer considers the activity task to be valid; the activity worker should clean up the activity task. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskHeartbeatTimeout: String?
        /// If set, specifies the default task list to use for scheduling tasks of this activity type. This default task list is used if a task list isn't provided when a task is scheduled through the ScheduleActivityTask Decision.
        public let defaultTaskList: TaskList?
        /// The default task priority to assign to the activity type. If not assigned, then 0 is used. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the in the Amazon SWF Developer Guide..
        public let defaultTaskPriority: String?
        /// If set, specifies the default maximum duration for a task of this activity type. This default can be overridden when scheduling an activity task using the ScheduleActivityTask Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskScheduleToCloseTimeout: String?
        /// If set, specifies the default maximum duration that a task of this activity type can wait before being assigned to a worker. This default can be overridden when scheduling an activity task using the ScheduleActivityTask Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskScheduleToStartTimeout: String?
        /// If set, specifies the default maximum duration that a worker can take to process tasks of this activity type. This default can be overridden when scheduling an activity task using the ScheduleActivityTask Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskStartToCloseTimeout: String?
        /// A textual description of the activity type.
        public let description: String?
        /// The name of the domain in which this activity is to be registered.
        public let domain: String
        /// The name of the activity type within the domain. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let name: String
        /// The version of the activity type.  The activity type consists of the name and version, the combination of which must be unique within the domain.  The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let version: String

        public init(defaultTaskHeartbeatTimeout: String? = nil, defaultTaskList: TaskList? = nil, defaultTaskPriority: String? = nil, defaultTaskScheduleToCloseTimeout: String? = nil, defaultTaskScheduleToStartTimeout: String? = nil, defaultTaskStartToCloseTimeout: String? = nil, description: String? = nil, domain: String, name: String, version: String) {
            self.defaultTaskHeartbeatTimeout = defaultTaskHeartbeatTimeout
            self.defaultTaskList = defaultTaskList
            self.defaultTaskPriority = defaultTaskPriority
            self.defaultTaskScheduleToCloseTimeout = defaultTaskScheduleToCloseTimeout
            self.defaultTaskScheduleToStartTimeout = defaultTaskScheduleToStartTimeout
            self.defaultTaskStartToCloseTimeout = defaultTaskStartToCloseTimeout
            self.description = description
            self.domain = domain
            self.name = name
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.defaultTaskHeartbeatTimeout, name: "defaultTaskHeartbeatTimeout", parent: name, max: 8)
            try self.defaultTaskList?.validate(name: "\(name).defaultTaskList")
            try self.validate(self.defaultTaskScheduleToCloseTimeout, name: "defaultTaskScheduleToCloseTimeout", parent: name, max: 8)
            try self.validate(self.defaultTaskScheduleToStartTimeout, name: "defaultTaskScheduleToStartTimeout", parent: name, max: 8)
            try self.validate(self.defaultTaskStartToCloseTimeout, name: "defaultTaskStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, max: 64)
            try self.validate(self.version, name: "version", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case defaultTaskHeartbeatTimeout
            case defaultTaskList
            case defaultTaskPriority
            case defaultTaskScheduleToCloseTimeout
            case defaultTaskScheduleToStartTimeout
            case defaultTaskStartToCloseTimeout
            case description
            case domain
            case name
            case version
        }
    }

    public struct RegisterDomainInput: AWSEncodableShape {
        /// A text description of the domain.
        public let description: String?
        /// Name of the domain to register. The name must be unique in the region that the domain is registered in. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let name: String
        /// Tags to be added when registering a domain. Tags may only contain unicode letters, digits, whitespace, or these symbols: _ . : / = + - @.
        public let tags: [ResourceTag]?
        /// The duration (in days) that records and histories of workflow executions on the domain should be kept by the service. After the retention period, the workflow execution isn't available in the results of visibility calls. If you pass the value NONE or 0 (zero), then the workflow execution history isn't retained. As soon as the workflow execution completes, the execution record and its history are deleted. The maximum workflow execution retention period is 90 days. For more information about Amazon SWF service limits, see: Amazon SWF Service Limits in the Amazon SWF Developer Guide.
        public let workflowExecutionRetentionPeriodInDays: String

        public init(description: String? = nil, name: String, tags: [ResourceTag]? = nil, workflowExecutionRetentionPeriodInDays: String) {
            self.description = description
            self.name = name
            self.tags = tags
            self.workflowExecutionRetentionPeriodInDays = workflowExecutionRetentionPeriodInDays
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.workflowExecutionRetentionPeriodInDays, name: "workflowExecutionRetentionPeriodInDays", parent: name, max: 8)
            try self.validate(self.workflowExecutionRetentionPeriodInDays, name: "workflowExecutionRetentionPeriodInDays", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case description
            case name
            case tags
            case workflowExecutionRetentionPeriodInDays
        }
    }

    public struct RegisterWorkflowTypeInput: AWSEncodableShape {
        /// If set, specifies the default policy to use for the child workflow executions when a workflow execution of this type is terminated, by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution Decision. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let defaultChildPolicy: ChildPolicy?
        /// If set, specifies the default maximum duration for executions of this workflow type. You can override this default when starting an execution through the StartWorkflowExecution Action or StartChildWorkflowExecution Decision. The duration is specified in seconds; an integer greater than or equal to 0. Unlike some of the other timeout parameters in Amazon SWF, you cannot specify a value of "NONE" for defaultExecutionStartToCloseTimeout; there is a one-year max limit on the time that a workflow execution can run. Exceeding this limit always causes the workflow execution to time out.
        public let defaultExecutionStartToCloseTimeout: String?
        /// The default IAM role attached to this workflow type.  Executions of this workflow type need IAM roles to invoke Lambda functions. If you don't specify an IAM role when you start this workflow type, the default Lambda role is attached to the execution. For more information, see https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html in the Amazon SWF Developer Guide.
        public let defaultLambdaRole: String?
        /// If set, specifies the default task list to use for scheduling decision tasks for executions of this workflow type. This default is used only if a task list isn't provided when starting the execution through the StartWorkflowExecution Action or StartChildWorkflowExecution Decision.
        public let defaultTaskList: TaskList?
        /// The default task priority to assign to the workflow type. If not assigned, then 0 is used. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let defaultTaskPriority: String?
        /// If set, specifies the default maximum duration of decision tasks for this workflow type. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskStartToCloseTimeout: String?
        /// Textual description of the workflow type.
        public let description: String?
        /// The name of the domain in which to register the workflow type.
        public let domain: String
        /// The name of the workflow type. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let name: String
        /// The version of the workflow type.  The workflow type consists of the name and version, the combination of which must be unique within the domain. To get a list of all currently registered workflow types, use the ListWorkflowTypes action.  The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let version: String

        public init(defaultChildPolicy: ChildPolicy? = nil, defaultExecutionStartToCloseTimeout: String? = nil, defaultLambdaRole: String? = nil, defaultTaskList: TaskList? = nil, defaultTaskPriority: String? = nil, defaultTaskStartToCloseTimeout: String? = nil, description: String? = nil, domain: String, name: String, version: String) {
            self.defaultChildPolicy = defaultChildPolicy
            self.defaultExecutionStartToCloseTimeout = defaultExecutionStartToCloseTimeout
            self.defaultLambdaRole = defaultLambdaRole
            self.defaultTaskList = defaultTaskList
            self.defaultTaskPriority = defaultTaskPriority
            self.defaultTaskStartToCloseTimeout = defaultTaskStartToCloseTimeout
            self.description = description
            self.domain = domain
            self.name = name
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.defaultExecutionStartToCloseTimeout, name: "defaultExecutionStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.defaultLambdaRole, name: "defaultLambdaRole", parent: name, max: 1600)
            try self.validate(self.defaultLambdaRole, name: "defaultLambdaRole", parent: name, min: 1)
            try self.defaultTaskList?.validate(name: "\(name).defaultTaskList")
            try self.validate(self.defaultTaskStartToCloseTimeout, name: "defaultTaskStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, max: 64)
            try self.validate(self.version, name: "version", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case defaultChildPolicy
            case defaultExecutionStartToCloseTimeout
            case defaultLambdaRole
            case defaultTaskList
            case defaultTaskPriority
            case defaultTaskStartToCloseTimeout
            case description
            case domain
            case name
            case version
        }
    }

    public struct RequestCancelActivityTaskDecisionAttributes: AWSEncodableShape {
        /// The activityId of the activity task to be canceled.
        public let activityId: String

        public init(activityId: String) {
            self.activityId = activityId
        }

        public func validate(name: String) throws {
            try self.validate(self.activityId, name: "activityId", parent: name, max: 256)
            try self.validate(self.activityId, name: "activityId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
        }
    }

    public struct RequestCancelActivityTaskFailedEventAttributes: AWSDecodableShape {
        /// The activityId provided in the RequestCancelActivityTask decision that failed.
        public let activityId: String
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: RequestCancelActivityTaskFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the RequestCancelActivityTask decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(activityId: String, cause: RequestCancelActivityTaskFailedCause, decisionTaskCompletedEventId: Int64) {
            self.activityId = activityId
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
            case cause
            case decisionTaskCompletedEventId
        }
    }

    public struct RequestCancelExternalWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        /// The data attached to the event that can be used by the decider in subsequent workflow tasks.
        public let control: String?
        /// The runId of the external workflow execution to cancel.
        public let runId: String?
        ///  The workflowId of the external workflow execution to cancel.
        public let workflowId: String

        public init(control: String? = nil, runId: String? = nil, workflowId: String) {
            self.control = control
            self.runId = runId
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.control, name: "control", parent: name, max: 32768)
            try self.validate(self.runId, name: "runId", parent: name, max: 64)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case runId
            case workflowId
        }
    }

    public struct RequestCancelExternalWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: RequestCancelExternalWorkflowExecutionFailedCause
        /// The data attached to the event that the decider can use in subsequent workflow tasks. This data isn't sent to the workflow execution.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the RequestCancelExternalWorkflowExecution decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The ID of the RequestCancelExternalWorkflowExecutionInitiated event corresponding to the RequestCancelExternalWorkflowExecution decision to cancel this external workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The runId of the external workflow execution.
        public let runId: String?
        /// The workflowId of the external workflow to which the cancel request was to be delivered.
        public let workflowId: String

        public init(cause: RequestCancelExternalWorkflowExecutionFailedCause, control: String? = nil, decisionTaskCompletedEventId: Int64, initiatedEventId: Int64, runId: String? = nil, workflowId: String) {
            self.cause = cause
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.initiatedEventId = initiatedEventId
            self.runId = runId
            self.workflowId = workflowId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case control
            case decisionTaskCompletedEventId
            case initiatedEventId
            case runId
            case workflowId
        }
    }

    public struct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes: AWSDecodableShape {
        /// Data attached to the event that can be used by the decider in subsequent workflow tasks.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the RequestCancelExternalWorkflowExecution decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The runId of the external workflow execution to be canceled.
        public let runId: String?
        /// The workflowId of the external workflow execution to be canceled.
        public let workflowId: String

        public init(control: String? = nil, decisionTaskCompletedEventId: Int64, runId: String? = nil, workflowId: String) {
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.runId = runId
            self.workflowId = workflowId
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case decisionTaskCompletedEventId
            case runId
            case workflowId
        }
    }

    public struct RequestCancelWorkflowExecutionInput: AWSEncodableShape {
        /// The name of the domain containing the workflow execution to cancel.
        public let domain: String
        /// The runId of the workflow execution to cancel.
        public let runId: String?
        /// The workflowId of the workflow execution to cancel.
        public let workflowId: String

        public init(domain: String, runId: String? = nil, workflowId: String) {
            self.domain = domain
            self.runId = runId
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.runId, name: "runId", parent: name, max: 64)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case runId
            case workflowId
        }
    }

    public struct ResourceTag: AWSEncodableShape & AWSDecodableShape {
        /// The key of a tag.
        public let key: String
        /// The value of a tag.
        public let value: String?

        public init(key: String, value: String? = nil) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case key
            case value
        }
    }

    public struct RespondActivityTaskCanceledInput: AWSEncodableShape {
        ///  Information about the cancellation.
        public let details: String?
        /// The taskToken of the ActivityTask.   taskToken is generated by the service and should be treated as an opaque value. If the task is passed to another process, its taskToken must also be passed. This enables it to provide its progress and respond with results.
        public let taskToken: String

        public init(details: String? = nil, taskToken: String) {
            self.details = details
            self.taskToken = taskToken
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 32768)
            try self.validate(self.taskToken, name: "taskToken", parent: name, max: 1024)
            try self.validate(self.taskToken, name: "taskToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case taskToken
        }
    }

    public struct RespondActivityTaskCompletedInput: AWSEncodableShape {
        /// The result of the activity task. It is a free form string that is implementation specific.
        public let result: String?
        /// The taskToken of the ActivityTask.   taskToken is generated by the service and should be treated as an opaque value. If the task is passed to another process, its taskToken must also be passed. This enables it to provide its progress and respond with results.
        public let taskToken: String

        public init(result: String? = nil, taskToken: String) {
            self.result = result
            self.taskToken = taskToken
        }

        public func validate(name: String) throws {
            try self.validate(self.result, name: "result", parent: name, max: 32768)
            try self.validate(self.taskToken, name: "taskToken", parent: name, max: 1024)
            try self.validate(self.taskToken, name: "taskToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case result
            case taskToken
        }
    }

    public struct RespondActivityTaskFailedInput: AWSEncodableShape {
        ///  Detailed information about the failure.
        public let details: String?
        /// Description of the error that may assist in diagnostics.
        public let reason: String?
        /// The taskToken of the ActivityTask.   taskToken is generated by the service and should be treated as an opaque value. If the task is passed to another process, its taskToken must also be passed. This enables it to provide its progress and respond with results.
        public let taskToken: String

        public init(details: String? = nil, reason: String? = nil, taskToken: String) {
            self.details = details
            self.reason = reason
            self.taskToken = taskToken
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 32768)
            try self.validate(self.reason, name: "reason", parent: name, max: 256)
            try self.validate(self.taskToken, name: "taskToken", parent: name, max: 1024)
            try self.validate(self.taskToken, name: "taskToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case details
            case reason
            case taskToken
        }
    }

    public struct RespondDecisionTaskCompletedInput: AWSEncodableShape {
        /// The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the Decision structure for details.
        public let decisions: [Decision]?
        /// User defined context to add to workflow execution.
        public let executionContext: String?
        /// The taskToken from the DecisionTask.   taskToken is generated by the service and should be treated as an opaque value. If the task is passed to another process, its taskToken must also be passed. This enables it to provide its progress and respond with results.
        public let taskToken: String

        public init(decisions: [Decision]? = nil, executionContext: String? = nil, taskToken: String) {
            self.decisions = decisions
            self.executionContext = executionContext
            self.taskToken = taskToken
        }

        public func validate(name: String) throws {
            try self.decisions?.forEach {
                try $0.validate(name: "\(name).decisions[]")
            }
            try self.validate(self.executionContext, name: "executionContext", parent: name, max: 32768)
            try self.validate(self.taskToken, name: "taskToken", parent: name, max: 1024)
            try self.validate(self.taskToken, name: "taskToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case decisions
            case executionContext
            case taskToken
        }
    }

    public struct Run: AWSDecodableShape {
        /// The runId of a workflow execution. This ID is generated by the service and can be used to uniquely identify the workflow execution within a domain.
        public let runId: String?

        public init(runId: String? = nil) {
            self.runId = runId
        }

        private enum CodingKeys: String, CodingKey {
            case runId
        }
    }

    public struct ScheduleActivityTaskDecisionAttributes: AWSEncodableShape {
        ///  The activityId of the activity task. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not contain the literal string arn.
        public let activityId: String
        ///  The type of the activity task to schedule.
        public let activityType: ActivityType
        /// Data attached to the event that can be used by the decider in subsequent workflow tasks. This data isn't sent to the activity.
        public let control: String?
        /// If set, specifies the maximum time before which a worker processing a task of this type must report progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically timed out. If the worker subsequently attempts to record a heartbeat or returns a result, it is ignored. This overrides the default heartbeat timeout specified when registering the activity type using RegisterActivityType. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let heartbeatTimeout: String?
        /// The input provided to the activity task.
        public let input: String?
        /// The maximum duration for this activity task. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  A schedule-to-close timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default schedule-to-close timeout was specified at registration time then a fault is returned.
        public let scheduleToCloseTimeout: String?
        ///  If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This overrides the default schedule-to-start timeout specified when registering the activity type using RegisterActivityType. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  A schedule-to-start timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default schedule-to-start timeout was specified at registration time then a fault is returned.
        public let scheduleToStartTimeout: String?
        /// If set, specifies the maximum duration a worker may take to process this activity task. This overrides the default start-to-close timeout specified when registering the activity type using RegisterActivityType. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  A start-to-close timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default start-to-close timeout was specified at registration time then a fault is returned.
        public let startToCloseTimeout: String?
        /// If set, specifies the name of the task list in which to schedule the activity task. If not specified, the defaultTaskList registered with the activity type is used.  A task list for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default task list was specified at registration time then a fault is returned.  The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not contain the literal string arn.
        public let taskList: TaskList?
        ///  If set, specifies the priority with which the activity task is to be assigned to a worker. This overrides the defaultTaskPriority specified when registering the activity type using RegisterActivityType. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?

        public init(activityId: String, activityType: ActivityType, control: String? = nil, heartbeatTimeout: String? = nil, input: String? = nil, scheduleToCloseTimeout: String? = nil, scheduleToStartTimeout: String? = nil, startToCloseTimeout: String? = nil, taskList: TaskList? = nil, taskPriority: String? = nil) {
            self.activityId = activityId
            self.activityType = activityType
            self.control = control
            self.heartbeatTimeout = heartbeatTimeout
            self.input = input
            self.scheduleToCloseTimeout = scheduleToCloseTimeout
            self.scheduleToStartTimeout = scheduleToStartTimeout
            self.startToCloseTimeout = startToCloseTimeout
            self.taskList = taskList
            self.taskPriority = taskPriority
        }

        public func validate(name: String) throws {
            try self.validate(self.activityId, name: "activityId", parent: name, max: 256)
            try self.validate(self.activityId, name: "activityId", parent: name, min: 1)
            try self.activityType.validate(name: "\(name).activityType")
            try self.validate(self.control, name: "control", parent: name, max: 32768)
            try self.validate(self.heartbeatTimeout, name: "heartbeatTimeout", parent: name, max: 8)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.scheduleToCloseTimeout, name: "scheduleToCloseTimeout", parent: name, max: 8)
            try self.validate(self.scheduleToStartTimeout, name: "scheduleToStartTimeout", parent: name, max: 8)
            try self.validate(self.startToCloseTimeout, name: "startToCloseTimeout", parent: name, max: 8)
            try self.taskList?.validate(name: "\(name).taskList")
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
            case activityType
            case control
            case heartbeatTimeout
            case input
            case scheduleToCloseTimeout
            case scheduleToStartTimeout
            case startToCloseTimeout
            case taskList
            case taskPriority
        }
    }

    public struct ScheduleActivityTaskFailedEventAttributes: AWSDecodableShape {
        /// The activityId provided in the ScheduleActivityTask decision that failed.
        public let activityId: String
        /// The activity type provided in the ScheduleActivityTask decision that failed.
        public let activityType: ActivityType
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: ScheduleActivityTaskFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision that resulted in the scheduling of this activity task. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64

        public init(activityId: String, activityType: ActivityType, cause: ScheduleActivityTaskFailedCause, decisionTaskCompletedEventId: Int64) {
            self.activityId = activityId
            self.activityType = activityType
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
        }

        private enum CodingKeys: String, CodingKey {
            case activityId
            case activityType
            case cause
            case decisionTaskCompletedEventId
        }
    }

    public struct ScheduleLambdaFunctionDecisionAttributes: AWSEncodableShape {
        /// The data attached to the event that the decider can use in subsequent workflow tasks. This data isn't sent to the Lambda task.
        public let control: String?
        /// A string that identifies the Lambda function execution in the event history.
        public let id: String
        /// The optional input data to be supplied to the Lambda function.
        public let input: String?
        /// The name, or ARN, of the Lambda function to schedule.
        public let name: String
        /// The timeout value, in seconds, after which the Lambda function is considered to be failed once it has started. This can be any integer from 1-300 (1s-5m). If no value is supplied, than a default value of 300s is assumed.
        public let startToCloseTimeout: String?

        public init(control: String? = nil, id: String, input: String? = nil, name: String, startToCloseTimeout: String? = nil) {
            self.control = control
            self.id = id
            self.input = input
            self.name = name
            self.startToCloseTimeout = startToCloseTimeout
        }

        public func validate(name: String) throws {
            try self.validate(self.control, name: "control", parent: name, max: 32768)
            try self.validate(self.id, name: "id", parent: name, max: 256)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.input, name: "input", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.startToCloseTimeout, name: "startToCloseTimeout", parent: name, max: 8)
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case id
            case input
            case name
            case startToCloseTimeout
        }
    }

    public struct ScheduleLambdaFunctionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. To help diagnose issues, use this information to trace back the chain of events leading up to this event.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: ScheduleLambdaFunctionFailedCause
        /// The ID of the LambdaFunctionCompleted event corresponding to the decision that resulted in scheduling this Lambda task. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The ID provided in the ScheduleLambdaFunction decision that failed.
        public let id: String
        /// The name of the Lambda function.
        public let name: String

        public init(cause: ScheduleLambdaFunctionFailedCause, decisionTaskCompletedEventId: Int64, id: String, name: String) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.id = id
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
            case id
            case name
        }
    }

    public struct SignalExternalWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        /// The data attached to the event that can be used by the decider in subsequent decision tasks.
        public let control: String?
        ///  The input data to be provided with the signal. The target workflow execution uses the signal name and input data to process the signal.
        public let input: String?
        /// The runId of the workflow execution to be signaled.
        public let runId: String?
        ///  The name of the signal.The target workflow execution uses the signal name and input to process the signal.
        public let signalName: String
        ///  The workflowId of the workflow execution to be signaled.
        public let workflowId: String

        public init(control: String? = nil, input: String? = nil, runId: String? = nil, signalName: String, workflowId: String) {
            self.control = control
            self.input = input
            self.runId = runId
            self.signalName = signalName
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.control, name: "control", parent: name, max: 32768)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.runId, name: "runId", parent: name, max: 64)
            try self.validate(self.signalName, name: "signalName", parent: name, max: 256)
            try self.validate(self.signalName, name: "signalName", parent: name, min: 1)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case input
            case runId
            case signalName
            case workflowId
        }
    }

    public struct SignalExternalWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: SignalExternalWorkflowExecutionFailedCause
        /// The data attached to the event that the decider can use in subsequent workflow tasks. This data isn't sent to the workflow execution.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the SignalExternalWorkflowExecution decision for this signal. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The ID of the SignalExternalWorkflowExecutionInitiated event corresponding to the SignalExternalWorkflowExecution decision to request this signal. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let initiatedEventId: Int64
        /// The runId of the external workflow execution that the signal was being delivered to.
        public let runId: String?
        /// The workflowId of the external workflow execution that the signal was being delivered to.
        public let workflowId: String

        public init(cause: SignalExternalWorkflowExecutionFailedCause, control: String? = nil, decisionTaskCompletedEventId: Int64, initiatedEventId: Int64, runId: String? = nil, workflowId: String) {
            self.cause = cause
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.initiatedEventId = initiatedEventId
            self.runId = runId
            self.workflowId = workflowId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case control
            case decisionTaskCompletedEventId
            case initiatedEventId
            case runId
            case workflowId
        }
    }

    public struct SignalExternalWorkflowExecutionInitiatedEventAttributes: AWSDecodableShape {
        /// Data attached to the event that can be used by the decider in subsequent decision tasks.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the SignalExternalWorkflowExecution decision for this signal. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The input provided to the signal.
        public let input: String?
        /// The runId of the external workflow execution to send the signal to.
        public let runId: String?
        /// The name of the signal.
        public let signalName: String
        /// The workflowId of the external workflow execution.
        public let workflowId: String

        public init(control: String? = nil, decisionTaskCompletedEventId: Int64, input: String? = nil, runId: String? = nil, signalName: String, workflowId: String) {
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.input = input
            self.runId = runId
            self.signalName = signalName
            self.workflowId = workflowId
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case decisionTaskCompletedEventId
            case input
            case runId
            case signalName
            case workflowId
        }
    }

    public struct SignalWorkflowExecutionInput: AWSEncodableShape {
        /// The name of the domain containing the workflow execution to signal.
        public let domain: String
        /// Data to attach to the WorkflowExecutionSignaled event in the target workflow execution's history.
        public let input: String?
        /// The runId of the workflow execution to signal.
        public let runId: String?
        /// The name of the signal. This name must be meaningful to the target workflow.
        public let signalName: String
        /// The workflowId of the workflow execution to signal.
        public let workflowId: String

        public init(domain: String, input: String? = nil, runId: String? = nil, signalName: String, workflowId: String) {
            self.domain = domain
            self.input = input
            self.runId = runId
            self.signalName = signalName
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.runId, name: "runId", parent: name, max: 64)
            try self.validate(self.signalName, name: "signalName", parent: name, max: 256)
            try self.validate(self.signalName, name: "signalName", parent: name, min: 1)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case input
            case runId
            case signalName
            case workflowId
        }
    }

    public struct StartChildWorkflowExecutionDecisionAttributes: AWSEncodableShape {
        ///  If set, specifies the policy to use for the child workflow executions if the workflow execution being started is terminated by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using RegisterWorkflowType. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.    A child policy for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default child policy was specified at registration time then a fault is returned.
        public let childPolicy: ChildPolicy?
        /// The data attached to the event that can be used by the decider in subsequent workflow tasks. This data isn't sent to the child workflow execution.
        public let control: String?
        /// The total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  An execution start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default execution start-to-close timeout was specified at registration time then a fault is returned.
        public let executionStartToCloseTimeout: String?
        /// The input to be provided to the workflow execution.
        public let input: String?
        /// The IAM role attached to the child workflow execution.
        public let lambdaRole: String?
        /// The list of tags to associate with the child workflow execution. A maximum of 5 tags can be specified. You can list workflow executions with a specific tag by calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and specifying a TagFilter.
        public let tagList: [String]?
        /// The name of the task list to be used for decision tasks of the child workflow execution.  A task list for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task list was specified at registration time then a fault is returned.  The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not contain the literal string arn.
        public let taskList: TaskList?
        ///  A task priority that, if set, specifies the priority for a decision task of this workflow execution. This overrides the defaultTaskPriority specified when registering the workflow type. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?
        /// Specifies the maximum duration of decision tasks for this workflow execution. This parameter overrides the defaultTaskStartToCloseTimout specified when registering the workflow type using RegisterWorkflowType. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  A task start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault is returned.
        public let taskStartToCloseTimeout: String?
        ///  The workflowId of the workflow execution. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not contain the literal string arn.
        public let workflowId: String
        ///  The type of the workflow execution to be started.
        public let workflowType: WorkflowType

        public init(childPolicy: ChildPolicy? = nil, control: String? = nil, executionStartToCloseTimeout: String? = nil, input: String? = nil, lambdaRole: String? = nil, tagList: [String]? = nil, taskList: TaskList? = nil, taskPriority: String? = nil, taskStartToCloseTimeout: String? = nil, workflowId: String, workflowType: WorkflowType) {
            self.childPolicy = childPolicy
            self.control = control
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.input = input
            self.lambdaRole = lambdaRole
            self.tagList = tagList
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
            self.workflowId = workflowId
            self.workflowType = workflowType
        }

        public func validate(name: String) throws {
            try self.validate(self.control, name: "control", parent: name, max: 32768)
            try self.validate(self.executionStartToCloseTimeout, name: "executionStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.lambdaRole, name: "lambdaRole", parent: name, max: 1600)
            try self.validate(self.lambdaRole, name: "lambdaRole", parent: name, min: 1)
            try self.tagList?.forEach {
                try validate($0, name: "tagList[]", parent: name, max: 256)
                try validate($0, name: "tagList[]", parent: name, min: 0)
            }
            try self.validate(self.tagList, name: "tagList", parent: name, max: 5)
            try self.taskList?.validate(name: "\(name).taskList")
            try self.validate(self.taskStartToCloseTimeout, name: "taskStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
            try self.workflowType.validate(name: "\(name).workflowType")
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case control
            case executionStartToCloseTimeout
            case input
            case lambdaRole
            case tagList
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
            case workflowId
            case workflowType
        }
    }

    public struct StartChildWorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  When cause is set to OPERATION_NOT_PERMITTED, the decision fails because it lacks sufficient permissions. For details and example IAM policies, see  Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: StartChildWorkflowExecutionFailedCause
        /// The data attached to the event that the decider can use in subsequent workflow tasks. This data isn't sent to the child workflow execution.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the StartChildWorkflowExecution Decision to request this child workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events.
        public let decisionTaskCompletedEventId: Int64
        /// When the cause is WORKFLOW_ALREADY_RUNNING, initiatedEventId is the ID of the StartChildWorkflowExecutionInitiated event that corresponds to the StartChildWorkflowExecution Decision to start the workflow execution. You can use this information to diagnose problems by tracing back the chain of events leading up to this event. When the cause isn't WORKFLOW_ALREADY_RUNNING, initiatedEventId is set to 0 because the StartChildWorkflowExecutionInitiated event doesn't exist.
        public let initiatedEventId: Int64
        /// The workflowId of the child workflow execution.
        public let workflowId: String
        /// The workflow type provided in the StartChildWorkflowExecution Decision that failed.
        public let workflowType: WorkflowType

        public init(cause: StartChildWorkflowExecutionFailedCause, control: String? = nil, decisionTaskCompletedEventId: Int64, initiatedEventId: Int64, workflowId: String, workflowType: WorkflowType) {
            self.cause = cause
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.initiatedEventId = initiatedEventId
            self.workflowId = workflowId
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case control
            case decisionTaskCompletedEventId
            case initiatedEventId
            case workflowId
            case workflowType
        }
    }

    public struct StartChildWorkflowExecutionInitiatedEventAttributes: AWSDecodableShape {
        /// The policy to use for the child workflow executions if this execution gets terminated by explicitly calling the TerminateWorkflowExecution action or due to an expired timeout. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let childPolicy: ChildPolicy
        /// Data attached to the event that can be used by the decider in subsequent decision tasks. This data isn't sent to the activity.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the StartChildWorkflowExecution Decision to request this child workflow execution. This information can be useful for diagnosing problems by tracing back the cause of events.
        public let decisionTaskCompletedEventId: Int64
        /// The maximum duration for the child workflow execution. If the workflow execution isn't closed within this duration, it is timed out and force-terminated. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let executionStartToCloseTimeout: String?
        /// The inputs provided to the child workflow execution.
        public let input: String?
        /// The IAM role to attach to the child workflow execution.
        public let lambdaRole: String?
        /// The list of tags to associated with the child workflow execution.
        public let tagList: [String]?
        /// The name of the task list used for the decision tasks of the child workflow execution.
        public let taskList: TaskList
        ///  The priority assigned for the decision tasks for this workflow execution. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?
        /// The maximum duration allowed for the decision tasks for this workflow execution. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let taskStartToCloseTimeout: String?
        /// The workflowId of the child workflow execution.
        public let workflowId: String
        /// The type of the child workflow execution.
        public let workflowType: WorkflowType

        public init(childPolicy: ChildPolicy, control: String? = nil, decisionTaskCompletedEventId: Int64, executionStartToCloseTimeout: String? = nil, input: String? = nil, lambdaRole: String? = nil, tagList: [String]? = nil, taskList: TaskList, taskPriority: String? = nil, taskStartToCloseTimeout: String? = nil, workflowId: String, workflowType: WorkflowType) {
            self.childPolicy = childPolicy
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.input = input
            self.lambdaRole = lambdaRole
            self.tagList = tagList
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
            self.workflowId = workflowId
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case control
            case decisionTaskCompletedEventId
            case executionStartToCloseTimeout
            case input
            case lambdaRole
            case tagList
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
            case workflowId
            case workflowType
        }
    }

    public struct StartLambdaFunctionFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. To help diagnose issues, use this information to trace back the chain of events leading up to this event.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because the IAM role attached to the execution lacked sufficient permissions. For details and example IAM policies, see Lambda Tasks in the Amazon SWF Developer Guide.
        public let cause: StartLambdaFunctionFailedCause?
        /// A description that can help diagnose the cause of the fault.
        public let message: String?
        /// The ID of the ActivityTaskScheduled event that was recorded when this activity task was scheduled. To help diagnose issues, use this information to trace back the chain of events leading up to this event.
        public let scheduledEventId: Int64?

        public init(cause: StartLambdaFunctionFailedCause? = nil, message: String? = nil, scheduledEventId: Int64? = nil) {
            self.cause = cause
            self.message = message
            self.scheduledEventId = scheduledEventId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case message
            case scheduledEventId
        }
    }

    public struct StartTimerDecisionAttributes: AWSEncodableShape {
        /// The data attached to the event that can be used by the decider in subsequent workflow tasks.
        public let control: String?
        ///  The duration to wait before firing the timer. The duration is specified in seconds, an integer greater than or equal to 0.
        public let startToFireTimeout: String
        ///  The unique ID of the timer. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not contain the literal string arn.
        public let timerId: String

        public init(control: String? = nil, startToFireTimeout: String, timerId: String) {
            self.control = control
            self.startToFireTimeout = startToFireTimeout
            self.timerId = timerId
        }

        public func validate(name: String) throws {
            try self.validate(self.control, name: "control", parent: name, max: 32768)
            try self.validate(self.startToFireTimeout, name: "startToFireTimeout", parent: name, max: 8)
            try self.validate(self.startToFireTimeout, name: "startToFireTimeout", parent: name, min: 1)
            try self.validate(self.timerId, name: "timerId", parent: name, max: 256)
            try self.validate(self.timerId, name: "timerId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case startToFireTimeout
            case timerId
        }
    }

    public struct StartTimerFailedEventAttributes: AWSDecodableShape {
        /// The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.  If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
        public let cause: StartTimerFailedCause
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the StartTimer decision for this activity task. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The timerId provided in the StartTimer decision that failed.
        public let timerId: String

        public init(cause: StartTimerFailedCause, decisionTaskCompletedEventId: Int64, timerId: String) {
            self.cause = cause
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.timerId = timerId
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case decisionTaskCompletedEventId
            case timerId
        }
    }

    public struct StartWorkflowExecutionInput: AWSEncodableShape {
        /// If set, specifies the policy to use for the child workflow executions of this workflow execution if it is terminated, by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using RegisterWorkflowType. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.    A child policy for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default child policy was specified at registration time then a fault is returned.
        public let childPolicy: ChildPolicy?
        /// The name of the domain in which the workflow execution is created.
        public let domain: String
        /// The total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The duration is specified in seconds; an integer greater than or equal to 0. Exceeding this limit causes the workflow execution to time out. Unlike some of the other timeout parameters in Amazon SWF, you cannot specify a value of "NONE" for this timeout; there is a one-year max limit on the time that a workflow execution can run.  An execution start-to-close timeout must be specified either through this parameter or as a default when the workflow type is registered. If neither this parameter nor a default execution start-to-close timeout is specified, a fault is returned.
        public let executionStartToCloseTimeout: String?
        /// The input for the workflow execution. This is a free form string which should be meaningful to the workflow you are starting. This input is made available to the new workflow execution in the WorkflowExecutionStarted history event.
        public let input: String?
        /// The IAM role to attach to this workflow execution.  Executions of this workflow type need IAM roles to invoke Lambda functions. If you don't attach an IAM role, any attempt to schedule a Lambda task fails. This results in a ScheduleLambdaFunctionFailed history event. For more information, see https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html in the Amazon SWF Developer Guide.
        public let lambdaRole: String?
        /// The list of tags to associate with the workflow execution. You can specify a maximum of 5 tags. You can list workflow executions with a specific tag by calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and specifying a TagFilter.
        public let tagList: [String]?
        /// The task list to use for the decision tasks generated for this workflow execution. This overrides the defaultTaskList specified when registering the workflow type.  A task list for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task list was specified at registration time then a fault is returned.  The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let taskList: TaskList?
        /// The task priority to use for this workflow execution. This overrides any default priority that was assigned when the workflow type was registered. If not set, then the default task priority for the workflow type is used. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?
        /// Specifies the maximum duration of decision tasks for this workflow execution. This parameter overrides the defaultTaskStartToCloseTimout specified when registering the workflow type using RegisterWorkflowType. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.  A task start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault is returned.
        public let taskStartToCloseTimeout: String?
        /// The user defined identifier associated with the workflow execution. You can use this to associate a custom identifier with the workflow execution. You may specify the same identifier if a workflow execution is logically a restart of a previous execution. You cannot have two open workflow executions with the same workflowId at the same time within the same domain. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.
        public let workflowId: String
        /// The type of the workflow to start.
        public let workflowType: WorkflowType

        public init(childPolicy: ChildPolicy? = nil, domain: String, executionStartToCloseTimeout: String? = nil, input: String? = nil, lambdaRole: String? = nil, tagList: [String]? = nil, taskList: TaskList? = nil, taskPriority: String? = nil, taskStartToCloseTimeout: String? = nil, workflowId: String, workflowType: WorkflowType) {
            self.childPolicy = childPolicy
            self.domain = domain
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.input = input
            self.lambdaRole = lambdaRole
            self.tagList = tagList
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
            self.workflowId = workflowId
            self.workflowType = workflowType
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.executionStartToCloseTimeout, name: "executionStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.input, name: "input", parent: name, max: 32768)
            try self.validate(self.lambdaRole, name: "lambdaRole", parent: name, max: 1600)
            try self.validate(self.lambdaRole, name: "lambdaRole", parent: name, min: 1)
            try self.tagList?.forEach {
                try validate($0, name: "tagList[]", parent: name, max: 256)
                try validate($0, name: "tagList[]", parent: name, min: 0)
            }
            try self.validate(self.tagList, name: "tagList", parent: name, max: 5)
            try self.taskList?.validate(name: "\(name).taskList")
            try self.validate(self.taskStartToCloseTimeout, name: "taskStartToCloseTimeout", parent: name, max: 8)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
            try self.workflowType.validate(name: "\(name).workflowType")
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case domain
            case executionStartToCloseTimeout
            case input
            case lambdaRole
            case tagList
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
            case workflowId
            case workflowType
        }
    }

    public struct TagFilter: AWSEncodableShape {
        ///  Specifies the tag that must be associated with the execution for it to meet the filter criteria. Tags may only contain unicode letters, digits, whitespace, or these symbols: _ . : / = + - @.
        public let tag: String

        public init(tag: String) {
            self.tag = tag
        }

        public func validate(name: String) throws {
            try self.validate(self.tag, name: "tag", parent: name, max: 256)
            try self.validate(self.tag, name: "tag", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case tag
        }
    }

    public struct TagResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the Amazon SWF domain.
        public let resourceArn: String
        /// The list of tags to add to a domain.  Tags may only contain unicode letters, digits, whitespace, or these symbols: _ . : / = + - @.
        public let tags: [ResourceTag]

        public init(resourceArn: String, tags: [ResourceTag]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case tags
        }
    }

    public struct TaskList: AWSEncodableShape & AWSDecodableShape {
        /// The name of the task list.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct TerminateWorkflowExecutionInput: AWSEncodableShape {
        /// If set, specifies the policy to use for the child workflow executions of the workflow execution being terminated. This policy overrides the child policy specified for the workflow execution at registration time or when starting the execution. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.    A child policy for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default child policy was specified at registration time then a fault is returned.
        public let childPolicy: ChildPolicy?
        ///  Details for terminating the workflow execution.
        public let details: String?
        /// The domain of the workflow execution to terminate.
        public let domain: String
        ///  A descriptive reason for terminating the workflow execution.
        public let reason: String?
        /// The runId of the workflow execution to terminate.
        public let runId: String?
        /// The workflowId of the workflow execution to terminate.
        public let workflowId: String

        public init(childPolicy: ChildPolicy? = nil, details: String? = nil, domain: String, reason: String? = nil, runId: String? = nil, workflowId: String) {
            self.childPolicy = childPolicy
            self.details = details
            self.domain = domain
            self.reason = reason
            self.runId = runId
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.details, name: "details", parent: name, max: 32768)
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.validate(self.reason, name: "reason", parent: name, max: 256)
            try self.validate(self.runId, name: "runId", parent: name, max: 64)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case details
            case domain
            case reason
            case runId
            case workflowId
        }
    }

    public struct TimerCanceledEventAttributes: AWSDecodableShape {
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the CancelTimer decision to cancel this timer. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The ID of the TimerStarted event that was recorded when this timer was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The unique ID of the timer that was canceled.
        public let timerId: String

        public init(decisionTaskCompletedEventId: Int64, startedEventId: Int64, timerId: String) {
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.startedEventId = startedEventId
            self.timerId = timerId
        }

        private enum CodingKeys: String, CodingKey {
            case decisionTaskCompletedEventId
            case startedEventId
            case timerId
        }
    }

    public struct TimerFiredEventAttributes: AWSDecodableShape {
        /// The ID of the TimerStarted event that was recorded when this timer was started. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let startedEventId: Int64
        /// The unique ID of the timer that fired.
        public let timerId: String

        public init(startedEventId: Int64, timerId: String) {
            self.startedEventId = startedEventId
            self.timerId = timerId
        }

        private enum CodingKeys: String, CodingKey {
            case startedEventId
            case timerId
        }
    }

    public struct TimerStartedEventAttributes: AWSDecodableShape {
        /// Data attached to the event that can be used by the decider in subsequent workflow tasks.
        public let control: String?
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the StartTimer decision for this activity task. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The duration of time after which the timer fires. The duration is specified in seconds, an integer greater than or equal to 0.
        public let startToFireTimeout: String
        /// The unique ID of the timer that was started.
        public let timerId: String

        public init(control: String? = nil, decisionTaskCompletedEventId: Int64, startToFireTimeout: String, timerId: String) {
            self.control = control
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.startToFireTimeout = startToFireTimeout
            self.timerId = timerId
        }

        private enum CodingKeys: String, CodingKey {
            case control
            case decisionTaskCompletedEventId
            case startToFireTimeout
            case timerId
        }
    }

    public struct UndeprecateActivityTypeInput: AWSEncodableShape {
        /// The activity type to undeprecate.
        public let activityType: ActivityType
        /// The name of the domain of the deprecated activity type.
        public let domain: String

        public init(activityType: ActivityType, domain: String) {
            self.activityType = activityType
            self.domain = domain
        }

        public func validate(name: String) throws {
            try self.activityType.validate(name: "\(name).activityType")
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case activityType
            case domain
        }
    }

    public struct UndeprecateDomainInput: AWSEncodableShape {
        /// The name of the domain of the deprecated workflow type.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name
        }
    }

    public struct UndeprecateWorkflowTypeInput: AWSEncodableShape {
        /// The name of the domain of the deprecated workflow type.
        public let domain: String
        /// The name of the domain of the deprecated workflow type.
        public let workflowType: WorkflowType

        public init(domain: String, workflowType: WorkflowType) {
            self.domain = domain
            self.workflowType = workflowType
        }

        public func validate(name: String) throws {
            try self.validate(self.domain, name: "domain", parent: name, max: 256)
            try self.validate(self.domain, name: "domain", parent: name, min: 1)
            try self.workflowType.validate(name: "\(name).workflowType")
        }

        private enum CodingKeys: String, CodingKey {
            case domain
            case workflowType
        }
    }

    public struct UntagResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the Amazon SWF domain.
        public let resourceArn: String
        /// The list of tags to remove from the Amazon SWF domain.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case tagKeys
        }
    }

    public struct WorkflowExecution: AWSEncodableShape & AWSDecodableShape {
        /// A system-generated unique identifier for the workflow execution.
        public let runId: String
        /// The user defined identifier associated with the workflow execution.
        public let workflowId: String

        public init(runId: String, workflowId: String) {
            self.runId = runId
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.runId, name: "runId", parent: name, max: 64)
            try self.validate(self.runId, name: "runId", parent: name, min: 1)
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case runId
            case workflowId
        }
    }

    public struct WorkflowExecutionCancelRequestedEventAttributes: AWSDecodableShape {
        /// If set, indicates that the request to cancel the workflow execution was automatically generated, and specifies the cause. This happens if the parent workflow execution times out or is terminated, and the child policy is set to cancel child executions.
        public let cause: WorkflowExecutionCancelRequestedCause?
        /// The ID of the RequestCancelExternalWorkflowExecutionInitiated event corresponding to the RequestCancelExternalWorkflowExecution decision to cancel this workflow execution.The source event with this ID can be found in the history of the source workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let externalInitiatedEventId: Int64?
        /// The external workflow execution for which the cancellation was requested.
        public let externalWorkflowExecution: WorkflowExecution?

        public init(cause: WorkflowExecutionCancelRequestedCause? = nil, externalInitiatedEventId: Int64? = nil, externalWorkflowExecution: WorkflowExecution? = nil) {
            self.cause = cause
            self.externalInitiatedEventId = externalInitiatedEventId
            self.externalWorkflowExecution = externalWorkflowExecution
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case externalInitiatedEventId
            case externalWorkflowExecution
        }
    }

    public struct WorkflowExecutionCanceledEventAttributes: AWSDecodableShape {
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the CancelWorkflowExecution decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The details of the cancellation.
        public let details: String?

        public init(decisionTaskCompletedEventId: Int64, details: String? = nil) {
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.details = details
        }

        private enum CodingKeys: String, CodingKey {
            case decisionTaskCompletedEventId
            case details
        }
    }

    public struct WorkflowExecutionCompletedEventAttributes: AWSDecodableShape {
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the CompleteWorkflowExecution decision to complete this execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The result produced by the workflow execution upon successful completion.
        public let result: String?

        public init(decisionTaskCompletedEventId: Int64, result: String? = nil) {
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.result = result
        }

        private enum CodingKeys: String, CodingKey {
            case decisionTaskCompletedEventId
            case result
        }
    }

    public struct WorkflowExecutionConfiguration: AWSDecodableShape {
        /// The policy to use for the child workflow executions if this workflow execution is terminated, by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let childPolicy: ChildPolicy
        /// The total duration for this workflow execution. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let executionStartToCloseTimeout: String
        /// The IAM role attached to the child workflow execution.
        public let lambdaRole: String?
        /// The task list used for the decision tasks generated for this workflow execution.
        public let taskList: TaskList
        /// The priority assigned to decision tasks for this workflow execution. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let taskPriority: String?
        /// The maximum duration allowed for decision tasks for this workflow execution. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let taskStartToCloseTimeout: String

        public init(childPolicy: ChildPolicy, executionStartToCloseTimeout: String, lambdaRole: String? = nil, taskList: TaskList, taskPriority: String? = nil, taskStartToCloseTimeout: String) {
            self.childPolicy = childPolicy
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.lambdaRole = lambdaRole
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case executionStartToCloseTimeout
            case lambdaRole
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
        }
    }

    public struct WorkflowExecutionContinuedAsNewEventAttributes: AWSDecodableShape {
        /// The policy to use for the child workflow executions of the new execution if it is terminated by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let childPolicy: ChildPolicy
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the ContinueAsNewWorkflowExecution decision that started this execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The total duration allowed for the new workflow execution. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let executionStartToCloseTimeout: String?
        /// The input provided to the new workflow execution.
        public let input: String?
        /// The IAM role to attach to the new (continued) workflow execution.
        public let lambdaRole: String?
        /// The runId of the new workflow execution.
        public let newExecutionRunId: String
        /// The list of tags associated with the new workflow execution.
        public let tagList: [String]?
        /// The task list to use for the decisions of the new (continued) workflow execution.
        public let taskList: TaskList
        /// The priority of the task to use for the decisions of the new (continued) workflow execution.
        public let taskPriority: String?
        /// The maximum duration of decision tasks for the new workflow execution. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let taskStartToCloseTimeout: String?
        /// The workflow type of this execution.
        public let workflowType: WorkflowType

        public init(childPolicy: ChildPolicy, decisionTaskCompletedEventId: Int64, executionStartToCloseTimeout: String? = nil, input: String? = nil, lambdaRole: String? = nil, newExecutionRunId: String, tagList: [String]? = nil, taskList: TaskList, taskPriority: String? = nil, taskStartToCloseTimeout: String? = nil, workflowType: WorkflowType) {
            self.childPolicy = childPolicy
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.input = input
            self.lambdaRole = lambdaRole
            self.newExecutionRunId = newExecutionRunId
            self.tagList = tagList
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case decisionTaskCompletedEventId
            case executionStartToCloseTimeout
            case input
            case lambdaRole
            case newExecutionRunId
            case tagList
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
            case workflowType
        }
    }

    public struct WorkflowExecutionCount: AWSDecodableShape {
        /// The number of workflow executions.
        public let count: Int
        /// If set to true, indicates that the actual count was more than the maximum supported by this API and the count returned is the truncated value.
        public let truncated: Bool?

        public init(count: Int, truncated: Bool? = nil) {
            self.count = count
            self.truncated = truncated
        }

        private enum CodingKeys: String, CodingKey {
            case count
            case truncated
        }
    }

    public struct WorkflowExecutionDetail: AWSDecodableShape {
        /// The configuration settings for this workflow execution including timeout values, tasklist etc.
        public let executionConfiguration: WorkflowExecutionConfiguration
        /// Information about the workflow execution.
        public let executionInfo: WorkflowExecutionInfo
        /// The time when the last activity task was scheduled for this workflow execution. You can use this information to determine if the workflow has not made progress for an unusually long period of time and might require a corrective action.
        public let latestActivityTaskTimestamp: Date?
        /// The latest executionContext provided by the decider for this workflow execution. A decider can provide an executionContext (a free-form string) when closing a decision task using RespondDecisionTaskCompleted.
        public let latestExecutionContext: String?
        /// The number of tasks for this workflow execution. This includes open and closed tasks of all types.
        public let openCounts: WorkflowExecutionOpenCounts

        public init(executionConfiguration: WorkflowExecutionConfiguration, executionInfo: WorkflowExecutionInfo, latestActivityTaskTimestamp: Date? = nil, latestExecutionContext: String? = nil, openCounts: WorkflowExecutionOpenCounts) {
            self.executionConfiguration = executionConfiguration
            self.executionInfo = executionInfo
            self.latestActivityTaskTimestamp = latestActivityTaskTimestamp
            self.latestExecutionContext = latestExecutionContext
            self.openCounts = openCounts
        }

        private enum CodingKeys: String, CodingKey {
            case executionConfiguration
            case executionInfo
            case latestActivityTaskTimestamp
            case latestExecutionContext
            case openCounts
        }
    }

    public struct WorkflowExecutionFailedEventAttributes: AWSDecodableShape {
        /// The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the FailWorkflowExecution decision to fail this execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let decisionTaskCompletedEventId: Int64
        /// The details of the failure.
        public let details: String?
        /// The descriptive reason provided for the failure.
        public let reason: String?

        public init(decisionTaskCompletedEventId: Int64, details: String? = nil, reason: String? = nil) {
            self.decisionTaskCompletedEventId = decisionTaskCompletedEventId
            self.details = details
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case decisionTaskCompletedEventId
            case details
            case reason
        }
    }

    public struct WorkflowExecutionFilter: AWSEncodableShape {
        /// The workflowId to pass of match the criteria of this filter.
        public let workflowId: String

        public init(workflowId: String) {
            self.workflowId = workflowId
        }

        public func validate(name: String) throws {
            try self.validate(self.workflowId, name: "workflowId", parent: name, max: 256)
            try self.validate(self.workflowId, name: "workflowId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case workflowId
        }
    }

    public struct WorkflowExecutionInfo: AWSDecodableShape {
        /// Set to true if a cancellation is requested for this workflow execution.
        public let cancelRequested: Bool?
        /// If the execution status is closed then this specifies how the execution was closed:    COMPLETED – the execution was successfully completed.    CANCELED – the execution was canceled.Cancellation allows the implementation to gracefully clean up before the execution is closed.    TERMINATED – the execution was force terminated.    FAILED – the execution failed to complete.    TIMED_OUT – the execution did not complete in the alloted time and was automatically timed out.    CONTINUED_AS_NEW – the execution is logically continued. This means the current execution was completed and a new execution was started to carry on the workflow.
        public let closeStatus: CloseStatus?
        /// The time when the workflow execution was closed. Set only if the execution status is CLOSED.
        public let closeTimestamp: Date?
        /// The workflow execution this information is about.
        public let execution: WorkflowExecution
        /// The current status of the execution.
        public let executionStatus: ExecutionStatus
        /// If this workflow execution is a child of another execution then contains the workflow execution that started this execution.
        public let parent: WorkflowExecution?
        /// The time when the execution was started.
        public let startTimestamp: Date
        /// The list of tags associated with the workflow execution. Tags can be used to identify and list workflow executions of interest through the visibility APIs. A workflow execution can have a maximum of 5 tags.
        public let tagList: [String]?
        /// The type of the workflow execution.
        public let workflowType: WorkflowType

        public init(cancelRequested: Bool? = nil, closeStatus: CloseStatus? = nil, closeTimestamp: Date? = nil, execution: WorkflowExecution, executionStatus: ExecutionStatus, parent: WorkflowExecution? = nil, startTimestamp: Date, tagList: [String]? = nil, workflowType: WorkflowType) {
            self.cancelRequested = cancelRequested
            self.closeStatus = closeStatus
            self.closeTimestamp = closeTimestamp
            self.execution = execution
            self.executionStatus = executionStatus
            self.parent = parent
            self.startTimestamp = startTimestamp
            self.tagList = tagList
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case cancelRequested
            case closeStatus
            case closeTimestamp
            case execution
            case executionStatus
            case parent
            case startTimestamp
            case tagList
            case workflowType
        }
    }

    public struct WorkflowExecutionInfos: AWSDecodableShape {
        /// The list of workflow information structures.
        public let executionInfos: [WorkflowExecutionInfo]
        /// If a NextPageToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextPageToken. Keep all other arguments unchanged. The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?

        public init(executionInfos: [WorkflowExecutionInfo], nextPageToken: String? = nil) {
            self.executionInfos = executionInfos
            self.nextPageToken = nextPageToken
        }

        private enum CodingKeys: String, CodingKey {
            case executionInfos
            case nextPageToken
        }
    }

    public struct WorkflowExecutionOpenCounts: AWSDecodableShape {
        /// The count of activity tasks whose status is OPEN.
        public let openActivityTasks: Int
        /// The count of child workflow executions whose status is OPEN.
        public let openChildWorkflowExecutions: Int
        /// The count of decision tasks whose status is OPEN. A workflow execution can have at most one open decision task.
        public let openDecisionTasks: Int
        /// The count of Lambda tasks whose status is OPEN.
        public let openLambdaFunctions: Int?
        /// The count of timers started by this workflow execution that have not fired yet.
        public let openTimers: Int

        public init(openActivityTasks: Int, openChildWorkflowExecutions: Int, openDecisionTasks: Int, openLambdaFunctions: Int? = nil, openTimers: Int) {
            self.openActivityTasks = openActivityTasks
            self.openChildWorkflowExecutions = openChildWorkflowExecutions
            self.openDecisionTasks = openDecisionTasks
            self.openLambdaFunctions = openLambdaFunctions
            self.openTimers = openTimers
        }

        private enum CodingKeys: String, CodingKey {
            case openActivityTasks
            case openChildWorkflowExecutions
            case openDecisionTasks
            case openLambdaFunctions
            case openTimers
        }
    }

    public struct WorkflowExecutionSignaledEventAttributes: AWSDecodableShape {
        /// The ID of the SignalExternalWorkflowExecutionInitiated event corresponding to the SignalExternalWorkflow decision to signal this workflow execution.The source event with this ID can be found in the history of the source workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event. This field is set only if the signal was initiated by another workflow execution.
        public let externalInitiatedEventId: Int64?
        /// The workflow execution that sent the signal. This is set only of the signal was sent by another workflow execution.
        public let externalWorkflowExecution: WorkflowExecution?
        /// The inputs provided with the signal. The decider can use the signal name and inputs to determine how to process the signal.
        public let input: String?
        /// The name of the signal received. The decider can use the signal name and inputs to determine how to the process the signal.
        public let signalName: String

        public init(externalInitiatedEventId: Int64? = nil, externalWorkflowExecution: WorkflowExecution? = nil, input: String? = nil, signalName: String) {
            self.externalInitiatedEventId = externalInitiatedEventId
            self.externalWorkflowExecution = externalWorkflowExecution
            self.input = input
            self.signalName = signalName
        }

        private enum CodingKeys: String, CodingKey {
            case externalInitiatedEventId
            case externalWorkflowExecution
            case input
            case signalName
        }
    }

    public struct WorkflowExecutionStartedEventAttributes: AWSDecodableShape {
        /// The policy to use for the child workflow executions if this workflow execution is terminated, by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let childPolicy: ChildPolicy
        /// If this workflow execution was started due to a ContinueAsNewWorkflowExecution decision, then it contains the runId of the previous workflow execution that was closed and continued as this execution.
        public let continuedExecutionRunId: String?
        /// The maximum duration for this workflow execution. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let executionStartToCloseTimeout: String?
        /// The input provided to the workflow execution.
        public let input: String?
        /// The IAM role attached to the workflow execution.
        public let lambdaRole: String?
        /// The ID of the StartChildWorkflowExecutionInitiated event corresponding to the StartChildWorkflowExecution Decision to start this workflow execution. The source event with this ID can be found in the history of the source workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
        public let parentInitiatedEventId: Int64?
        /// The source workflow execution that started this workflow execution. The member isn't set if the workflow execution was not started by a workflow.
        public let parentWorkflowExecution: WorkflowExecution?
        /// The list of tags associated with this workflow execution. An execution can have up to 5 tags.
        public let tagList: [String]?
        /// The name of the task list for scheduling the decision tasks for this workflow execution.
        public let taskList: TaskList
        /// The priority of the decision tasks in the workflow execution.
        public let taskPriority: String?
        /// The maximum duration of decision tasks for this workflow type. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let taskStartToCloseTimeout: String?
        /// The workflow type of this execution.
        public let workflowType: WorkflowType

        public init(childPolicy: ChildPolicy, continuedExecutionRunId: String? = nil, executionStartToCloseTimeout: String? = nil, input: String? = nil, lambdaRole: String? = nil, parentInitiatedEventId: Int64? = nil, parentWorkflowExecution: WorkflowExecution? = nil, tagList: [String]? = nil, taskList: TaskList, taskPriority: String? = nil, taskStartToCloseTimeout: String? = nil, workflowType: WorkflowType) {
            self.childPolicy = childPolicy
            self.continuedExecutionRunId = continuedExecutionRunId
            self.executionStartToCloseTimeout = executionStartToCloseTimeout
            self.input = input
            self.lambdaRole = lambdaRole
            self.parentInitiatedEventId = parentInitiatedEventId
            self.parentWorkflowExecution = parentWorkflowExecution
            self.tagList = tagList
            self.taskList = taskList
            self.taskPriority = taskPriority
            self.taskStartToCloseTimeout = taskStartToCloseTimeout
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case continuedExecutionRunId
            case executionStartToCloseTimeout
            case input
            case lambdaRole
            case parentInitiatedEventId
            case parentWorkflowExecution
            case tagList
            case taskList
            case taskPriority
            case taskStartToCloseTimeout
            case workflowType
        }
    }

    public struct WorkflowExecutionTerminatedEventAttributes: AWSDecodableShape {
        /// If set, indicates that the workflow execution was automatically terminated, and specifies the cause. This happens if the parent workflow execution times out or is terminated and the child policy is set to terminate child executions.
        public let cause: WorkflowExecutionTerminatedCause?
        /// The policy used for the child workflow executions of this workflow execution. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let childPolicy: ChildPolicy
        /// The details provided for the termination.
        public let details: String?
        /// The reason provided for the termination.
        public let reason: String?

        public init(cause: WorkflowExecutionTerminatedCause? = nil, childPolicy: ChildPolicy, details: String? = nil, reason: String? = nil) {
            self.cause = cause
            self.childPolicy = childPolicy
            self.details = details
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case cause
            case childPolicy
            case details
            case reason
        }
    }

    public struct WorkflowExecutionTimedOutEventAttributes: AWSDecodableShape {
        /// The policy used for the child workflow executions of this workflow execution. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let childPolicy: ChildPolicy
        /// The type of timeout that caused this event.
        public let timeoutType: WorkflowExecutionTimeoutType

        public init(childPolicy: ChildPolicy, timeoutType: WorkflowExecutionTimeoutType) {
            self.childPolicy = childPolicy
            self.timeoutType = timeoutType
        }

        private enum CodingKeys: String, CodingKey {
            case childPolicy
            case timeoutType
        }
    }

    public struct WorkflowType: AWSEncodableShape & AWSDecodableShape {
        ///  The name of the workflow type.  The combination of workflow type name and version must be unique with in a domain.
        public let name: String
        ///  The version of the workflow type.  The combination of workflow type name and version must be unique with in a domain.
        public let version: String

        public init(name: String, version: String) {
            self.name = name
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, max: 64)
            try self.validate(self.version, name: "version", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case version
        }
    }

    public struct WorkflowTypeConfiguration: AWSDecodableShape {
        ///  The default policy to use for the child workflow executions when a workflow execution of this type is terminated, by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution Decision. The supported child policies are:    TERMINATE – The child executions are terminated.    REQUEST_CANCEL – A request to cancel is attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.    ABANDON – No action is taken. The child executions continue to run.
        public let defaultChildPolicy: ChildPolicy?
        ///  The default maximum duration, specified when registering the workflow type, for executions of this workflow type. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultExecutionStartToCloseTimeout: String?
        /// The default IAM role attached to this workflow type.  Executions of this workflow type need IAM roles to invoke Lambda functions. If you don't specify an IAM role when starting this workflow type, the default Lambda role is attached to the execution. For more information, see https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html in the Amazon SWF Developer Guide.
        public let defaultLambdaRole: String?
        ///  The default task list, specified when registering the workflow type, for decisions tasks scheduled for workflow executions of this type. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution Decision.
        public let defaultTaskList: TaskList?
        ///  The default task priority, specified when registering the workflow type, for all decision tasks of this workflow type. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution decision. Valid values are integers that range from Java's Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate higher priority. For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.
        public let defaultTaskPriority: String?
        ///  The default maximum duration, specified when registering the workflow type, that a decision task for executions of this workflow type might take before returning completion or failure. If the task doesn'tdo close in the specified time then the task is automatically timed out and rescheduled. If the decider eventually reports a completion or failure, it is ignored. This default can be overridden when starting a workflow execution using the StartWorkflowExecution action or the StartChildWorkflowExecution Decision. The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.
        public let defaultTaskStartToCloseTimeout: String?

        public init(defaultChildPolicy: ChildPolicy? = nil, defaultExecutionStartToCloseTimeout: String? = nil, defaultLambdaRole: String? = nil, defaultTaskList: TaskList? = nil, defaultTaskPriority: String? = nil, defaultTaskStartToCloseTimeout: String? = nil) {
            self.defaultChildPolicy = defaultChildPolicy
            self.defaultExecutionStartToCloseTimeout = defaultExecutionStartToCloseTimeout
            self.defaultLambdaRole = defaultLambdaRole
            self.defaultTaskList = defaultTaskList
            self.defaultTaskPriority = defaultTaskPriority
            self.defaultTaskStartToCloseTimeout = defaultTaskStartToCloseTimeout
        }

        private enum CodingKeys: String, CodingKey {
            case defaultChildPolicy
            case defaultExecutionStartToCloseTimeout
            case defaultLambdaRole
            case defaultTaskList
            case defaultTaskPriority
            case defaultTaskStartToCloseTimeout
        }
    }

    public struct WorkflowTypeDetail: AWSDecodableShape {
        /// Configuration settings of the workflow type registered through RegisterWorkflowType
        public let configuration: WorkflowTypeConfiguration
        /// General information about the workflow type. The status of the workflow type (returned in the WorkflowTypeInfo structure) can be one of the following.    REGISTERED – The type is registered and available. Workers supporting this type should be running.    DEPRECATED – The type was deprecated using DeprecateWorkflowType, but is still in use. You should keep workers supporting this type running. You cannot create new workflow executions of this type.
        public let typeInfo: WorkflowTypeInfo

        public init(configuration: WorkflowTypeConfiguration, typeInfo: WorkflowTypeInfo) {
            self.configuration = configuration
            self.typeInfo = typeInfo
        }

        private enum CodingKeys: String, CodingKey {
            case configuration
            case typeInfo
        }
    }

    public struct WorkflowTypeFilter: AWSEncodableShape {
        ///  Name of the workflow type.
        public let name: String
        /// Version of the workflow type.
        public let version: String?

        public init(name: String, version: String? = nil) {
            self.name = name
            self.version = version
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.version, name: "version", parent: name, max: 64)
        }

        private enum CodingKeys: String, CodingKey {
            case name
            case version
        }
    }

    public struct WorkflowTypeInfo: AWSDecodableShape {
        /// The date when this type was registered.
        public let creationDate: Date
        /// If the type is in deprecated state, then it is set to the date when the type was deprecated.
        public let deprecationDate: Date?
        /// The description of the type registered through RegisterWorkflowType.
        public let description: String?
        /// The current status of the workflow type.
        public let status: RegistrationStatus
        /// The workflow type this information is about.
        public let workflowType: WorkflowType

        public init(creationDate: Date, deprecationDate: Date? = nil, description: String? = nil, status: RegistrationStatus, workflowType: WorkflowType) {
            self.creationDate = creationDate
            self.deprecationDate = deprecationDate
            self.description = description
            self.status = status
            self.workflowType = workflowType
        }

        private enum CodingKeys: String, CodingKey {
            case creationDate
            case deprecationDate
            case description
            case status
            case workflowType
        }
    }

    public struct WorkflowTypeInfos: AWSDecodableShape {
        /// If a NextPageToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextPageToken. Keep all other arguments unchanged. The configured maximumPageSize determines how many results can be returned in a single call.
        public let nextPageToken: String?
        /// The list of workflow type information.
        public let typeInfos: [WorkflowTypeInfo]

        public init(nextPageToken: String? = nil, typeInfos: [WorkflowTypeInfo]) {
            self.nextPageToken = nextPageToken
            self.typeInfos = typeInfos
        }

        private enum CodingKeys: String, CodingKey {
            case nextPageToken
            case typeInfos
        }
    }
}
